Re: [w3ctag/design-reviews] Incubation: Lightweight and Conditional Tracing for long animation frame timing API (Issue #1224)

noamr left a comment (w3ctag/design-reviews#1224)

> Thanks [@guohuideng2024](https://github.com/guohuideng2024). Your reasoning for adding new functions makes sense to me. I'm still not sure whether this is the right name, and whether it will be quite the right design once you add a second Performance reporting API that monitors these user timing points.
> 
> 1. Ideally function names describe what they apply to. "Conditional" doesn't indicate what the condition is. Something like "markForPerformanceIncident" might explain itself better, but you and the working group can probably come up with a more explanatory name than I can.
> 2. Is it possible that developers will want to say that a mark applies to `LoAF` but not `EventTiming` or vice versa? If so, you're going to need to add an options dictionary to the parameters. Once you've done that for `measureConditional`, you'll want to move `startMark` and `endMark` inside it.
> 
> https://w3ctag.github.io/design-principles/#prefer-dictionaries also suggests that your optional parameters should be inside an options dictionary even without the extra field to select the kind of performance incident.

The original performance issues raised by frameworks folks were more about structured serialization into the "detail" property in user timing.

However, [`performance.measure()`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure) supports both dictionary values and positional start/end. We can do this in the future with WebIDL without breaking web-compat, and because of the performance footgun of `detail` I think it's OK to leave it for later.

So to summarize, the exception to the "prefer dictionaries" rule is for consistency with an existing API, and we can revise that in the future in a compatible way since that original API exposes both shapes.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/1224#issuecomment-6794860107
You are receiving this because you are subscribed to this thread.

Message ID: <w3ctag/design-reviews/issues/1224/6794860107@github.com>

Received on Wednesday, 11 November 2026 11:42:33 UTC