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

feat: Improve performance of multi-period DASH parsing #5350

Merged

Conversation

baconz
Copy link
Contributor

@baconz baconz commented Jun 23, 2023

For manifests with many streams, we saw the bulk of the manifest parse time going towards period combiner. Specifically: splitting codecs and comparing DRMs. This change cuts our manifest parse time for large manifests by nearly 30%.

There are two changes:

  1. Memoize the normalized codecs inside the period combiner.
  2. Short circuit the DRM compatibility check if the DRMInfos arrays are the same object. We run a custom manifest parser and are therefore able to re-use the same drm infos array for functionally equivalent drms, but short circuiting also helps since in the case that the upstream period combiner is comparing a candidate stream with itself.

For manifests with many streams, we saw the bullk of the manifest parse
time going towards period combiner. Specifically: splitting codecs and
comparing DRMs. This change cuts our manifest parse time for large manifests
by nearly 30%.

There are two changes:

1. Memoize the normalized codecs inside the period combiner.
2. Short circuit the DRM compatibility check if the DRMInfos arrays
   are the same object. We run a custom manifest parser and are therefore
   able to re-use the same drm infos array for functionally equivalent drms, but
   short circuiting also helps since in the case that the upstream period combiner
   is comparing a candidate stream with itself.
@github-actions
Copy link
Contributor

Incremental code coverage: 72.73%

@avelad avelad added type: enhancement New feature or request priority: P3 Useful but not urgent component: DASH The issue involves the MPEG DASH manifest format labels Jun 24, 2023
@avelad avelad added this to the v4.4 milestone Jun 24, 2023
@avelad avelad requested review from joeyparrish and theodab June 24, 2023 11:00
@joeyparrish joeyparrish changed the title feat: Optimizations to improve performance of the period combiner. feat: Improve performance of multi-period DASH parsing Jun 26, 2023
@joeyparrish joeyparrish merged commit 5b0b429 into shaka-project:main Jun 26, 2023
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Aug 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: DASH The issue involves the MPEG DASH manifest format priority: P3 Useful but not urgent status: archived Archived and locked; will not be updated type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants