ยฉ 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#โ€ข2y agoโ€ข
20 replies
MONO

How to Optimize my API calls?

Trying to get better at some C# with WPFUI, and started a project, is kinda of an imdb application. Showing TV shows, movies, info on both and actors etc.
Im using an API to get all the latest movies from one place, and get the ID's from that JSON list. Putting them into an List.
And then load all the movie info from another API(TMDB), using the IDs from the first.

Its working just fine, but when loading, it takes like 5-10sec before anything is being shown.
And when scrolling, its starting to load the new posters, so that takes another 3-5 sec before loading. If i then scroll back up, its loading the first rows again, taking another 3-5 sec.
It seems kinda weird and im not sure how to get the scrolling fixed, and how to optimize the API calls, so it does not take 5-10 sec for the info to load.

Can this be done in a better way then what i have done?
I have created a Gist how give a better view of the code:
https://gist.github.com/PatrickRorth/4b634a10eb4a47bd7621d159cfa73d0e

I have also added a small recording, showing how it reloads images again after scrolling.

Any help would be appriciated.
Gist
Optimize API
Optimize API. GitHub Gist: instantly share code, notes, and snippets.
Optimize API
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

How to optimize this?
C#CC# / help
3y ago
โœ… How to optimize this code?
C#CC# / help
16mo ago
โœ… How to optimize this method?
C#CC# / help
2y ago