-
-
Notifications
You must be signed in to change notification settings - Fork 465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VideoClient.GetAsync is extremely slow #459
Comments
Performance improvements are always welcome. |
Can someone profile this with clear separation between CPU-bound operations and IO-bound operations? I want to know how much of the time is actually taken by tasks we can optimize vs just network requests to YouTube which are likely unavoidable. |
Doing private static async Task Main(string[] args)
{
YoutubeClient client = new();
Stopwatch sw = Stopwatch.StartNew();
Video video = await client.Videos.GetAsync(args[0]);
Console.WriteLine(sw.Elapsed.ToString());
Console.WriteLine(video.Title);
} with the same video provided takes 4.7s just to do the GetAsync (time from the stopwatch, so it doesn't include whole runtime startup), so I'd say there must be a lot of room for improvements. |
Try the new version, I removed a lot of code from this flow. It should be faster now. |
While profiling our youtube playback code i've noticed that VideoClient.GetAsync takes about 2.3 seconds to complete (as you can see on this screenshot in the last column).
Playback dely resulting from this is quite noticeable and really impacts user experience.
We can reproduce this behaviour on every try.
The text was updated successfully, but these errors were encountered: