Skip to content

chore(html): improve HTML report payload loading speeds #36768

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

Merged
merged 2 commits into from
Jul 24, 2025

Conversation

agg23
Copy link
Contributor

@agg23 agg23 commented Jul 23, 2025

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 the script 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

Screenshot 2025-07-23 at 11 50 34 AM

Before

Screenshot 2025-07-23 at 11 55 00 AM

@agg23 agg23 requested review from pavelfeldman and mxschmitt July 23, 2025 19:12
@agg23
Copy link
Contributor Author

agg23 commented Jul 23, 2025

@microsoft-github-policy-service rerun

This comment has been minimized.

zipReport.load().then(() => setReport(zipReport));
}, [report]);
zipReport.load().then(() => {
// Drop node with duplicate data if it exists to free up memory
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Drop node with duplicate data if it exists to free up memory
// Drop node once successfully consumed

Isn't it more like that?

Copy link
Member

@Skn0tt Skn0tt left a comment

Choose a reason for hiding this comment

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

lovely!

@agg23 agg23 merged commit de9fde3 into microsoft:main Jul 24, 2025
32 checks passed
Copy link
Contributor

Test results for "tests 1"

6 flaky ⚠️ [chromium-library] › library/chromium/oopif.spec.ts:284:3 › should click @chromium-ubuntu-22.04-node20
⚠️ [chromium-library] › library/chromium/oopif.spec.ts:284:3 › should click @chromium-ubuntu-22.04-node24
⚠️ [chromium-library] › library/popup.spec.ts:258:3 › should not throw when click closes popup @chromium-ubuntu-22.04-node24
⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:1079:7 › cli codegen › should not throw csp directive violation errors @firefox-ubuntu-22.04-node18
⚠️ [firefox-library] › library/inspector/cli-codegen-pick-locator.spec.ts:35:7 › should update locator highlight @firefox-ubuntu-22.04-node18
⚠️ [playwright-test] › ui-mode-test-watch.spec.ts:145:5 › should watch all @ubuntu-latest-node22-1

46805 passed, 928 skipped
✔️✔️✔️

Merge workflow run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants