Reduce collector overhead - #165
Open
mattcosta7 wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Reduces collector overhead by scoping DOM work, coalescing asynchronous sampling, and replacing prototype instrumentation with native LoAF evidence.
Changes:
- Scopes mutation and layer scans to the story root.
- Adds cancellable RAF/idle pipelines and opt-in telemetry.
- Adds native forced-layout metrics and benchmark comparison tooling.
Show a summary per file
| File | Description |
|---|---|
.changeset/reduce-collector-overhead.md |
Records the minor release. |
README.md |
Documents metrics, telemetry, and benchmarking. |
performance-panel.tsx |
Displays native forced-layout LoAF counts. |
package.json |
Adds the benchmark comparator command. |
core/preview-core.ts |
Integrates optional telemetry. |
core/performance-types.ts |
Adds the native LoAF metric and alias semantics. |
core/overhead-telemetry.ts |
Implements overhead telemetry. |
core/__tests__/overhead-telemetry.browser.test.ts |
Tests telemetry aggregation. |
collectors/README.md |
Updates collector documentation. |
collectors/attribution.ts |
Escapes generated selectors. |
collectors/collector-manager.ts |
Scopes collectors and aggregates native metrics. |
collectors/element-timing-collector.ts |
Instruments callback overhead. |
collectors/forced-reflow-collector.ts |
Removes prototype instrumentation. |
collectors/frame-timing-collector.ts |
Tracks RAF callback and pending work. |
collectors/input-collector.ts |
Coalesces pointer RAF sampling. |
collectors/layout-shift-collector.ts |
Instruments observer callbacks. |
collectors/long-animation-frame-collector.ts |
Counts forced-layout LoAFs. |
collectors/main-thread-collector.ts |
Instruments long-task processing. |
collectors/paint-collector.ts |
Adds scoped, chunked layer scans. |
collectors/react-profiler-collector.ts |
Instruments profiler callbacks. |
collectors/style-mutation-collector.ts |
Scopes mutation observation. |
collectors/__tests__/attribution.browser.test.ts |
Tests selector escaping. |
collectors/__tests__/collector-manager.browser.test.ts |
Tests scoping, aliases, and telemetry. |
collectors/__tests__/forced-reflow-collector.browser.test.ts |
Removes obsolete instrumentation tests. |
collectors/__tests__/input-collector.browser.test.ts |
Tests RAF coalescing and cancellation. |
collectors/__tests__/long-animation-frame-collector.browser.test.ts |
Tests forced-layout counts. |
collectors/__tests__/paint-collector.browser.test.ts |
Tests scoped chunked scans. |
collectors/__tests__/style-mutation-collector.browser.test.ts |
Tests scoped mutation collection. |
__tests__/performance-decorator-universal.browser.test.ts |
Tests serialization telemetry. |
__benchmarks__/overhead.browser.bench.tsx |
Adds the telemetry probe. |
__benchmarks__/compare-results.ts |
Adds read-only benchmark comparison. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 31/31 changed files
- Comments generated: 1
- Review effort level: Balanced
| ], | ||
| "scripts": { | ||
| "benchmark": "vitest bench --config vitest.benchmark.config.ts --outputJson benchmark-results.json", | ||
| "benchmark:compare": "node __benchmarks__/compare-results.ts benchmark-results.json", |
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.
Summary
Benchmark
Compared with the tracked baseline from #161:
The tracked baseline was not modified.
Validation
npm run tscnpm run lintnpm run buildattwpublintStacked on #164. Keep this PR in draft while the v1.3 stack is reviewed.