Commit Graph
3 Commits
Author SHA1 Message Date
google-labs-jules[bot]andPR0M3TH3AN 0f97852eb8 Refactor releaseScope in dynamicStyles.js to avoid O(N) stylesheet scan.
Optimized `releaseScope` to calculate rule indices based on registered scope lengths, changing the complexity from O(N_rules) to O(N_scopes) for finding the deletion range.
Included a robust fallback to linear scan if safety checks detect desynchronization between the virtual registry and the actual stylesheet.
Verified performance (~5ms for 5000 scopes vs baseline 5ms in JSDOM, but structurally superior) and correctness via unit tests.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-05 20:31:23 +00:00
google-labs-jules[bot]andPR0M3TH3AN 55fd791186 perf: optimize batch scope release in dynamicStyles.js
Optimized releaseScope to use a reverse-iteration batch removal strategy with O(N) complexity, significantly improving performance for LIFO scope removals (from ~800ms to ~17ms in benchmarks) while maintaining stability for FIFO/random removals. Removed unused findRuleIndex helper.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-05 19:41:09 +00:00
thePR0M3TH3AN 17086c9eff Refactor floating panel and metrics styling 2025-10-14 13:31:22 -04:00