-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
perf: Caching mediaSource support for browser engine #4778
Conversation
@JulianDomingo, can you test if on chromecast we have this gain? |
Incremental code coverage: 97.56% |
@BrainChen You can apply the |
@avelad There seems exists cyclic dependencies when I implemented it in |
@avelad Emmm, I think the change on |
@avelad Sorry for not obeying the precheck. |
Thank you for your contribution! |
@theodab @avelad @joeyparrish Will this change be cherry-picked to |
If it cherry-picks cleanly, then yes, I will cherry-pick this to v3.2.x as well as all the other active branches. If not, I'll let you know and you can make a PR against v3.2.x to get it into the next v3.2 release. |
@vasanth-fl Be aware that some of the old shaka versions, |
Caches the results of MediaSource.isTypeSupported, which is slow on some platforms, to reduce the number of calls needed. This is especially helpful on manifests with many similar variants (multiple languages, etc). Data collected from 2 months of practical testing shows that this helps reduce the start lag by 40% on Chromecast, 15% on WebOS, and 12% on Tizen.
This did not cherry-pick cleanly to older branches. It was released in v4.3.1 only. |
@BrainChen thanks for the inputs! @joeyparrish thanks for the note. We will try to analyse and try to make a PR against |
We have just derived the repository by the old shaka version and found there seems the same optimization could be implemented on the latest shaka player.
When developing on each web core livingroom platform (Tizen, WebOS, Chromecast, etc.), we found that there takes a long time to parse the manifest between downloading the manifest and downloading the first content segment. After profiling it, we found that there was a frequent function called
MediaSource.isTypeSupported
in it, up to hundreds or even thousands (the pic attached below). But this situation does not happen on the latest Chrome or Safari.We concluded that it must be related to the old browser engine (Chromium) that does not do optimization on it.
And we just cached the function call results and let it not calls that API so frequently. The data showed that it did help reduce the start lag by 40% on Chromecast, 15% on WebOS, and 12% on Tizen on average within 2 months.
We think it is constructive and want to share it. And we think the more variants the contents have, the more time they could be reduced on living room apps.
Thanks!