perf: Optimise DASH manifest generation #870
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces various optimisations to DASH manifest generation. I have checked that the generated XML is still the same as before.
normalizeTag
name to just change the first character to upper case.TEXT_ELEMENT
wrapper object and then give thatTEXT_ELEMENT
object special treatment inrenderElementToString
to treat it as a string. As our target is just a string and not some DOM like environment, I simplified it to just pass through the string and then to give it special treatment if it is a string. That means the code is simpler and we are creating less temporary objects..filter()
,.map()
, checking the.length
, then calling.join()
and appending it to the element string to afor-of
loop with anif
that appends directly to the element string.The DASH manifest generation still isn't ideal (parser structure -> streaming info structure -> jsx elements tree -> string) but these changes will at least improve it a bit, without major refactoring.