Open
Conversation
7c544c1 to
1a82da2
Compare
|
Your pull request has conflicts that need to be resolved before it can be reviewed and merged. Make sure to rebase your branch on top of the latest |
1a82da2 to
535866f
Compare
0c0ad03 to
f1fb980
Compare
Add a marker system for profiler timeline events. Design and rationale are documented in Documentation/Profiler/Markers.md.
Add collectMarkers() and clearMarkers() to the Internals interface for testing marker emission. collectMarkers() takes a thread-safe snapshot of the marker collector and returns an array of plain objects with name, type, phase, category, timing, and field properties. An optional type filter narrows results to a specific marker schema.
Add Marker test mode to test-web, --collect-markers plumbing, and a GC marker in Heap.cpp. Include all 12 test files; four pass now (basic, clear, filter, gc), eight have FAIL expectations that flip as subsequent commits add markers.
Add markers to Document and ViewportPaintable covering the core rendering pipeline: - Style: MARKER_SCOPE for update_style with sub-labels for :has() invalidation, style invalidation, media rules, and recompute - Layout: MARKER_SCOPE for update_layout with sub-labels for tree build and formatting context - Paint: MARKER_SCOPE for record_display_list and paint_all_phases - Navigation: instant markers for Document::create and readiness state transitions (DOMLoading, DOMInteractive, DOMComplete) - Observers: interval markers for IntersectionObserver, ResizeObserver, and animation/transition events
Emit a DOMEvent marker scope around event dispatch with event type, target node name, latency, and standard event flags (bubbles, cancelable, composed, isTrusted).
Add MARKER_SCOPE for the HTML parse phase and instant markers for DOMContentLoaded and Load events in the parser end state machine.
Emit a ParseCSS MARKER_SCOPE when parsing a CSS stylesheet, including the stylesheet URL in the marker fields.
Add markers to the HTML event loop and timer infrastructure: - Task execution intervals with source-specific names and categories - setTimeout/setInterval callback intervals with delay and ID fields - requestAnimationFrame callback scope - Microtask checkpoint intervals (filtered to >= 2 queued microtasks to reduce noise; Firefox does not emit these at all)
Emit UserTiming markers for performance.mark() (instant) and performance.measure() (interval). Measure timestamps are converted from DOMHighResTimeStamp to MonotonicTime for accurate placement on the profiler timeline.
Emit ConsoleTime IntervalStart/IntervalEnd markers for console.time() and console.timeEnd(), using the timer label as the marker name.
Add markers across web platform APIs: - Network: fetch start, XHR send, WebSocket new/send, font face load - Scripting: classic script evaluation scope, off-thread parse/codegen intervals on both worker and main threads - Input: mouse down, key down instant markers - Storage: localStorage setItem - History: pushState/replaceState - Media: HTMLMediaElement.play - Observers: MutationObserver callback intervals - Image: decode interval with URL and byte count
Emit a MARKER_SCOPE around each IPC message handler invocation with the message name as a searchable field.
Add interval markers for FFmpeg demuxing and audio/video decoding with track type, byte count, and PTS fields.
f1fb980 to
db5bf82
Compare
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.
Add a marker collection system for profiler timeline events, inspired by Firefox's marker infrastructure. Markers are timestamped events emitted from engine code that let a profiler UI explain what happened: layout, style, GC, script parsing, DOM events, timers, network, IPC, and media decode.
The public API is a small set of macros in LibCore/Markers.h that gate all argument evaluation behind a relaxed atomic bool check. When no collector is active, cost per call site is one atomic load and a predicted-not-taken branch, no clock reads, no allocations, no string formatting. Design rationale is documented in Documentation/Profiler/Markers.md.
This PR includes 46 markers, they serve as test cases for the reset of the profiling subsystems (profiler, devtools integration, firefox profiling export) and are expected to change over time.
An example of what we are working towards can be seen on this link: https://share.firefox.dev/3Qim8IG
I expect 5-6 PRs before we can get there (marker, profiler, webcontent hookup, devtools, exporter), wip branch of all of the pieces integrated, can be found here.