chore(html): improve HTML report payload loading speeds #36768
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.
Currently the HTML report embeds the entire report payload into a JavaScript
script
tag. This results in the browser HTML loading process passing over the bytes multiple times and increasing memory load. Move the data to be raw text, removing at least one pass and one in memory copy. Additionally delete thescript
tag once we've consumed the data, to ensure there's only one in memory copy at the end of loading.In a large report scenario where a payload totaled ~165MB was loaded locally (thus with negligible network latency + throughput restriction), this change results in loading taking approximately half of the time on latest Chrome. This seemed to be consistent across reloads and restarts of Chrome, but will likely vary by browser and significantly by network.
After
Before