perf(userscripts): reduce redundant DOM scans and renders - #290
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Frequent quote updates, media mutations, and panel ticks performed repeated document scans, layout reads, and DOM replacement. This change reduces that work in six userscripts while preserving their data, lifecycle, and trading contracts.
The audit covers all eight repository-owned scripts. Deterministic examples reduce CMC layout reads from 6,020 to 8, video scans from 100 to 1, and Strategy29 list replacements across ten empty increments from 10 to 0. These are operation counts from controlled fixtures, not live-page CPU or memory measurements. The report and reproduction commands are in
docs/userscript-performance-review.md.Validation: all 1,017 unit/DOM tests and all 80 Chromium tests passed with retries disabled on Node 24.16.0. All five generated artifacts exactly match current source builds and the tested SHA-256 values; all eight install scripts passed syntax checks and the staged diff passed whitespace validation. Chinese and numeric symbols, including
龙虾USDTand4USDT, remain covered by inspected Chromium depth fixtures. The CMC fixture's initial UTF-8 declaration defect was fixed before the final complete browser run.Validation limits: the user-browser inspection during implementation was blocked by the browser caller-identity policy, and no logged-in Brooks export was exercised. Independent read-only review attempts did not return a verdict because model services were unavailable. Installed-source readback and post-reload live-source verification are separate release checks.