-
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
UITextDisplayer.append or Cue.equal is very slow, especially on Chromecasts #3018
Labels
status: archived
Archived and locked; will not be updated
type: bug
Something isn't working correctly
Milestone
Comments
the append function looks like this:
If external cc is loaded, and has 1000+ cues, shaka.text.Cue.equal will trigger millions of times. One idea to solve this is to hash cues based on start/end times and then just compare those hashed values between each other. About 99% of
|
joeyparrish
added
type: bug
Something isn't working correctly
and removed
needs triage
labels
Dec 21, 2020
joeyparrish
pushed a commit
that referenced
this issue
Dec 23, 2020
When a VTT cue spans a segment boundary, the cue will be duplicated across two segments. To avoid displaying duplicate cues, we compare the cues to be appended with the cues already in the list. 1. We can assume the cues to be appended at once have no duplicates. Make a copy of the current cues list, and compare the new cues only with the cues in the current cues list. If we append m new cues to a list of n cues, we can reduce the times to compare the cues from m*m*n/2 times to m*n times. 2. We compare the cues deeply by comparing their nested cues and all the elements. We can compare their start time, end time and payload first, and only compare their nested cues and all other elements when their start time, end time and payload are the same. If cue1 and cue2 both have m nested cues, we may not need to compare the nested cues instead of comparing m times. Fixes #3018 Backported to v3.0.x Change-Id: I9992f0e1834fd16e8aedaf1895b036bc7ca29190
joeyparrish
pushed a commit
that referenced
this issue
Jan 6, 2021
When a VTT cue spans a segment boundary, the cue will be duplicated across two segments. To avoid displaying duplicate cues, we compare the cues to be appended with the cues already in the list. 1. We can assume the cues to be appended at once have no duplicates. Make a copy of the current cues list, and compare the new cues only with the cues in the current cues list. If we append m new cues to a list of n cues, we can reduce the times to compare the cues from m*m*n/2 times to m*n times. 2. We compare the cues deeply by comparing their nested cues and all the elements. We can compare their start time, end time and payload first, and only compare their nested cues and all other elements when their start time, end time and payload are the same. If cue1 and cue2 both have m nested cues, we may not need to compare the nested cues instead of comparing m times. Fixes #3018 Backported to v2.5.x Change-Id: I9992f0e1834fd16e8aedaf1895b036bc7ca29190
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
status: archived
Archived and locked; will not be updated
type: bug
Something isn't working correctly
Have you read the FAQ and checked for duplicate open issues?
Yes
What version of Shaka Player are you using?
3.0.5 and 3.0.6
Can you reproduce the issue with our latest release version?
Yes
Can you reproduce the issue with the latest code from
master
?Yes
Are you using the demo app or your own custom app?
Custom app
If custom app, can you reproduce the issue using our demo app?
Yes
What browser and OS are you using?
Cast Sender: Chrome 87/Windows 10
Cast Receiver: Chrome 76/Chromecast Ultra
For embedded devices (smart TVs, etc.), what model and firmware version are you using?
Chromecast Ultra 1.42.183786 (User agent:
Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.81 Safari/537.36 CrKey/1.42.183786
)What are the manifest and license server URIs?
I might be able to provide this via email, but if you have a title with lots of text track cue's (1,000+), I'd expect that to work the same.
What did you do?
streaming.alwaysStreamText
totrue
.Note that the longer the content (or one with more dialog), the worse this start up time seems to be. I'm testing on an action movie that has 1275 lines of dialog (basically I mean it's a VTT with 1275
-->
occurrences).What did you expect to happen?
The video to begin without waiting over 30+ seconds for the text track to parse.
What actually happened?
Basically any loading of text tracks on a Chromecast (weather it's selected prior to casting, changed while casting, or having
streaming.alwaysStreamText
totrue
) takes an unreasonably long time on text tracks of a movie length.I'd assume this would impact non-Cast devices too. Running a performance profile on the debug Shaka demo site for the same content on my Chrome (a desktop Core i7, not the Cast Receiver) took ~600ms. 😬 An underpowered/older Android phone could take seconds (perhaps tens of seconds), but I don't have evidence of this.
Here's a screenshot of the performance tab of the receiver's inspect window after I switched text tracks. I did save Chrome's performance profile, if it's needed.
It looks like this this was introduced in 3.0.5 with the changes made to
cue.js
andarray_utils.js
.The text was updated successfully, but these errors were encountered: