Skip to content
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: Improve performance of addThumbnailsTrack #6067

Merged
merged 2 commits into from Jan 11, 2024

Conversation

avelad
Copy link
Collaborator

@avelad avelad commented Jan 10, 2024

Fixes #6065

@avelad avelad added type: performance A performance issue priority: P1 Big impact or workaround impractical; resolve before feature release labels Jan 10, 2024
@avelad avelad added this to the v5.0 milestone Jan 10, 2024
[uri], [cue.payload])[0];
let uris = null;
const getUris = () => {
if (uris == null) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand why not resolving all of the uris at once in a huge thumbnails track might improve performance, but is there a specific reason we want to no longer use shaka.util.ManifestParserUtils.resolveUris for this? It seems like it'd be a smaller change for getUris to just be something like:

const getUris = () => {
  if (uris == null) {
    uris = shaka.util.ManifestParserUtils.resolveUris([uri], [cue.playload]);
  }
  return uris || [];
};

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I’ll change it

@avelad avelad requested a review from theodab January 10, 2024 10:19
@avelad avelad dismissed theodab’s stale review January 11, 2024 07:39

Reviewed by Casey

@avelad avelad merged commit 3a14047 into shaka-project:main Jan 11, 2024
12 of 16 checks passed
@avelad avelad deleted the perf-addThumbnailsTrack branch January 11, 2024 07:40
avelad added a commit that referenced this pull request Jan 11, 2024
avelad added a commit that referenced this pull request Jan 11, 2024
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Mar 11, 2024
@shaka-project shaka-project locked as resolved and limited conversation to collaborators Mar 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority: P1 Big impact or workaround impractical; resolve before feature release status: archived Archived and locked; will not be updated type: performance A performance issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Player.addThumbnailsTrack() is slow and freezes the browser for long videos
4 participants