Contact emails
[email protected], [email protected]

Explainer
https://github.com/WICG/js-self-profiling/blob/main/markers.md


Specification
https://wicg.github.io/js-self-profiling


Design docs

https://github.com/WICG/js-self-profiling/blob/main/markers.md
https://github.com/WICG/js-self-profiling/pull/89


Summary
The JavaScript Self-Profiling API lets a web application sample its own call 
stacks to measure performance on real user devices. This feature adds an 
optional marker field to each captured sample that identifies the type of 
browser activity running when the sample was taken: script, gc, style, layout, 
paint, or other. A trace normally shows gaps between stacks that cannot be 
interpreted, markers let developers attribute that time to browser work 
happening outside their JavaScript, for example distinguishing script execution 
from style recalculation, layout, or a garbage collection pause, making slow 
traces easier to analyze and optimize.


Blink component
Blink>PerformanceAPIs


Web Feature ID
4217


Motivation
The JavaScript Self-Profiling API lets web apps sample their own call stacks on 
real user devices, but it profiles only the page's JavaScript, leaving 
unexplained gaps where time went to style, layout, paint, or garbage 
collection. Some of that work, like GC, interrupts stack execution and is 
invisible to stack sampling. A per-sample marker identifies the browser 
activity, letting developers attribute slow field traces to non-JavaScript work 
and optimize accordingly.


Initial public proposal
https://github.com/WICG/js-self-profiling/blob/main/markers.md


TAG review
https://github.com/w3ctag/design-reviews/issues/1251


TAG review status
Issues open


Origin Trial Name
JS Self-Profiling Markers


Goals for experimentation
Validate that JS Self-Profiling markers provide actionable performance signal 
for large real-world web applications when collected from real users, and 
confirm the marker data flows correctly end-to-end through production RUM 
pipelines. Specifically, we want to learn: - Whether per-sample markers let 
developers attribute slow field traces to browser activity outside their 
JavaScript (rendering, style/layout, GC) and act on it. - Whether the sampled 
marker data is accurate and stable enough at production scale (real devices, 
real workloads) to drive optimization decisions. - Whether the API shape 
(ProfilerSample.marker) is ergonomic for existing self-profiling consumers to 
adopt with minimal code change. Interested partners include Excel Online, which 
will consume the trial to enrich its existing JS self-profiling telemetry, and 
Datadog, which collects JS self-profiling data as part of its RUM product.


Chromium Trial Name
JSSelfProfilingMarkers


Origin Trial documentation link
https://github.com/WICG/js-self-profiling/blob/main/markers.md


WebFeature UseCounter name
WebDXFeature::kJSSelfProfilingMarkers


Risks




Interoperability and Compatibility
The base JS Self-Profiling API and marker extension remain Chromium-only. Gecko 
has no markers-specific position, and WebKit's position request remains open 
with concerns/questions discussed. Cross-engine adoption is therefore 
uncertain. The extension adds an optional sample field without changing 
existing profiling entry points. Consumers must tolerate missing markers and 
differing marker availability: non-COI contexts expose only style/layout, while 
COI contexts may expose the full vocabulary. Internal activity mapping is 
implementation-defined, so tools must not assume identical distributions across 
engines or interpret an absent marker as proof of idle.

Gecko: No signal (https://github.com/mozilla/standards-positions/issues/477) No 
position on the markers extension. The position request for the base JS 
Self-Profiling API remains open.

WebKit: No signal (https://github.com/WebKit/standards-positions/issues/717) No 
separate position on the markers extension. WebKit previously expressed 
opposition to the base JS Self-Profiling API; discussion covering the base API 
and markers is ongoing.

Web developers: Positive (https://github.com/WICG/js-self-profiling/issues/71) 
Excel has registered for the origin trial, reported positive results. Datadog 
also plans to evaluate the extension. Public developer feedback also highlights 
its value for diagnosing main-thread bottlenecks, with requests for additional 
parsing and compilation detail.

Other signals:


Ergonomics
The extension adds an optional marker field without changing how profiling is 
started or stopped. Marker availability depends on isolation: non-COI documents 
receive style/layout, while COI documents may receive the full vocabulary. 
Consumers must tolerate absent markers and implementation-dependent activity 
mapping. An absent marker does not necessarily mean idle.


Activation
Adoption is straightforward for existing JS Self-Profiling consumers. The main 
barrier is cross-origin isolation, required for script, gc, paint, and other 
markers. Non-isolated documents receive only style and layout. The origin trial 
enables evaluation but does not waive these isolation requirements.


Security
Moderate, and mitigated by design. Some browser work is shared across documents 
in a process, so exposing it could leak cross-origin timing: gc is not 
attributable to a single origin, and paint could act as a proxy for the render 
time of cross-origin opaque resources that fail a TAO check. To mitigate, 
script, gc, and paint markers are gated behind cross-origin isolation, in a COI 
process the document can already observe process-wide signals (Spectre threat 
model, performance.measureMemory, WeakRef), so these markers add no new 
leverage. style and layout are exposed without isolation because their timing 
is already observable through existing DOM/CSSOM APIs (getBoundingClientRect, 
getComputedStyle), consistent with Long Animation Frames. Markers attributable 
to a document are only attached when that document is same-origin with the 
profiler. Security discussion is tracked in 
https://github.com/WICG/js-self-profiling/issues/61 (Chrome security reviewed 
the COI-gated design in 2021, the non-isolated style/layout exposure is under 
active review).


WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it 
has potentially high risk for Android WebView-based applications?
Low. This is an additive optional field on the existing JS Self-Profiling API 
and does not change existing application behavior. Marker availability depends 
on the page's profiling permissions and cross-origin-isolation capability. 
Existing consumers can continue to use traces without markers.



Debuggability
Developers can inspect ProfilerTrace.samples to see each sample's timestamp, 
optional stack ID, and activity marker. The trace can be logged or visualized 
using the sample demos to investigate browser work alongside JavaScript 
execution. Marker availability depends on cross-origin isolation; a missing 
marker does not necessarily mean idle.


Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, 
ChromeOS, Android, and Android WebView)?
Yes


Is this feature fully tested by web-platform-tests?
Yes
https://wpt.fyi/results/js-self-profiling/marker-vm-state.https.html


DevTrial instructions
https://github.com/victorhuangwq/js-profiler-markers-demo


Flag name on about://flags
--enable-blink-features=ExperimentalJSProfilerMarkers


Finch feature name
JSSelfProfilingMarkers


Rollout plan
Will ship enabled for all users


Requires code in //chrome?
False


Tracking bug
https://issues.chromium.org/issues/40800459


Measurement
Adoption will be monitored through the existing 
WebDXFeature::kJSSelfProfilingMarkers use counter. Origin-trial feedback from 
Excel Online and planned evaluation by Datadog will help assess whether markers 
improve attribution of performance bottlenecks and integrate effectively with 
existing profiling workflows. The use counter measures feature usage, not the 
usefulness or accuracy of individual markers.


Availability expectation
The feature is expected to remain Chromium-only in the near term. Gecko and 
WebKit have not yet provided implementation signals. We will continue 
standardization in WICG and pursue broader interoperability.


Adoption expectation
Existing JS Self-Profiling consumers can adopt markers with limited integration 
changes. Excel Online has registered for the origin trial, reported positive 
results, and indicated plans to use the extension after shipping. Datadog plans 
to evaluate the extension.


Adoption plan
Complete the Origin Trial with production feedback from Excel Online and 
Datadog, publish documentation and a refined sample, share the feature through 
Chrome/Edge developer channels, and use partner feedback to improve the 
specification and tooling guidance.


Non-OSS dependencies

Does the feature depend on any code or APIs outside the Chromium open source 
repository and its open-source dependencies to function?
No. The feature is implemented entirely in Chromium/Blink/V8 and has no 
server-side or closed-source dependency.


Estimated milestones


Shipping on desktop 162

Origin trial desktop first 153

Origin trial desktop last 161

DevTrial on desktop 148

Shipping on Android 162

DevTrial on Android 148

Shipping on WebView 162




Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop 
issues. Please list open issues (eg links to known github issues in the project 
for the feature specification) whose resolution may introduce web 
compat/interop risk (eg, changing to naming or structure of the API in a 
non-backward-compatible way).
No specification changes are currently anticipated for shipping. The marker 
vocabulary and isolation-based exposure rules are defined in the merged 
specification. Any further changes will be considered based on origin-trial 
feedback and ongoing standards discussions.


Link to entry on the Chrome Platform Status
https://chromestatus.com/feature/5201297767792640?gate=6065556001259520


Links to previous Intent discussions
Intent to Experiment: 
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/6a72681c.c91ea2f1.3ad85a.01ad.GAE%40google.com



This intent message was generated by Chrome Platform Status.

-- 
You received this message because you are subscribed to the Google Groups 
"blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/6b0092a7.b4eb56a8.1e9e55.00a1.GAE%40google.com.

Reply via email to