#1224: Incubation: Lightweight and Conditional Tracing for long animation frame timing API

Visit on Github

Opened Apr 28, 2026

Explainer

https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/ConditionalTracing/explainer-for-loaf.md

The explainer

Where and by whom is the work is being done?

Feedback so far

  • Multi-stakeholder feedback:
    • Chromium comments: planning to prototype this and work with the WebPerfWG.
    • Mozilla comments: TBD
    • WebKit comments: TBD
  • Major unresolved issues with or opposition to this design: N/A

You should also know that...

No response

<!-- Content below this is maintained by @w3c-tag-bot -->

Track conversations at https://tag-github-bot.w3.org/gh/w3ctag/design-reviews/1224

Discussions

Log in to see TAG-private discussions.

Discussed May 18, 2026 (See Github)

Lola: yesterday, we went through the issue triage. This issue, and the next, we couldn't find anyone to take on in Atlantic breakout. So we wanted to assign them from this breakout. Anyone?

The first is performance-based. It's looking at measuring the performance for animations.

Xiaocheng: I will look at this.

Discussed May 18, 2026 (See Github)

Jeffrey: I believe this will be in web-perf eventually, but it's currently in incubation.

Lola: Anyone want to take this? Hearing nothing, I can ask in Slack or in Eurasia tomorrow.

Discussed Jun 1, 2026 (See Github)

Jeffrey: Xiaocheng drafted a response https://github.com/w3ctag/design-reviews-private-brainstorming/issues/279#issuecomment-4542454000

Heather: I have no problem with the draft response. We are just making comments, not asking questions - would we close it or leave it open for them to respond.

Jeffrey: I think this is a good question for Xiaocheng because they didn't suggest whether it is "satisfied with concerns" or wanted to ask questions

Heather: Could we leave it open for a set period of time

Jeffrey: Or we could ask a question.. I see that Matthew had been involved in the previous approach - I would like to ask Matthew what he thinks - and otherwise say this breakout is happy with the reply.

Brian: That sounds reasonable.

Jeffrey: I have replied to the brainstorming issue - once they are happy they can just post.

Discussed Jun 8, 2026 (See Github)

Xiaocheng: I have a proposed comment in the thread.

Heather: I'm good with that comment. Any concerns?

<none -- Xiaocheng to post the comment>

Comment by @xiaochengh Jun 10, 2026 (See Github)

Hi @guohuideng2024, the TAG reviewed this and fount it much more plausible than the previous approach. The overall mechanism looks highly feasible to us.

We have some comments at a lower level regarding the API design.

  1. The proposed new APIs markCondition() and measureConditional() are directly tied to long animation frames, and therefore:
    • The connection between these APIs and LoAF is not clear from the names and may be confusing
    • This is not extendable to use cases like, e.g., we want to analyze long tasks instead of long animation frames, or if there are new types of performance incidents we want to introduce in the future
  2. We are also unsure why we need to introduce "conditional" marks and measures, instead of somehow allowing existing marks and measures to be attributed to LoAF and similar incidents.
Comment by @hlflanagan Aug 3, 2026 (See Github)

Hi @guohuideng2024 - did you or the group have any response to the TAG's comments?

Comment by @guohuideng2024 Aug 5, 2026 (See Github)

cc: @noamr

Apologies for the late reply!

  1. "long task" is monitored/reported by LoAF. A single long task is sufficient to emit a LoAF. Therefore, after this feature is implemented the conditional user timing can analyze long tasks.

  2. Our intention is that "conditional user timing" is not only tied to LoAF(Long animation frame), but a collection of Performance reporting API. "LoAF" is the very first Performance reporting API that monitors and includes these user timing points. Thus, we use a very general word "conditional". And we do intend to expand this to other user cases, like EventTiming or even ElementTiming in the near future.

  3. We use a new name/API like markConditional instead of expanding the existing performance.mark, based on a number of considerations.

    a) They behavior very different from regular performance.mark/measure: There is no overlap between where regular mark/measure can appear and where these conditional user timing can appear; conditional user timing points and regular user timing points never interact each other(both interact within the same kind); the conditional user points (after the future expansion) operates in parallel in a number of different timelines; even the implementation of conditional user timing has very little overlap of that for user timing.

    So, conditional user timing is a completely new breed of user timing, unlike anything that existed before.

    b) We want the app developers to be able to deploy more such user timing points, so the user timing points must be lightweight, with minimal performance overhead. Unfortunately, the existing performance.mark/measure has a so large collection of functionalities built in, that operations on them cost too much CPU and memory (for example, sorting is required even for a performance.mark). Therefore, we explicitly want to exclude these Options in the existing Performance.mark/measure. By using a new API/name it's clear that the interface is different.

Discussed Aug 10, 2026 (See Github)

skip

Discussed Sep 21, 2026 (See Github)

Jeffrey: Since we started this review, we should finish it. I'll develop an opinion.

Discussed Oct 5, 2026 (See Github)

Jeffrey: I haven't done this yet, but will work on it.

Discussed Oct 12, 2026 (See Github)

Heather: I missed seeing Jeffrey's comment on this. Does anyone have any concerns with his follow up question?

<no concerns>
Comment by @jyasskin Oct 14, 2026 (See Github)

Thanks @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.

Comment by @noamr Oct 14, 2026 (See Github)

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.

This suggestion should not apply for calls like this that are expected to be called very eagerly, due to WebIDL dictionary<->JS overhead.

Comment by @jyasskin Oct 14, 2026 (See Github)

@noamr Can you give us some performance measurements that could go into such an exception in the Design Principles? How much time does it cost per call to wrap a string argument into a dictionary? How much can that be mitigated by caching the JS object? Approximately how many times/second does a function need to be called for you to think it needs the less-ergonomic signature?