#1013: Paint/presentation timestamps in performance APIs

Visit on Github

Opened Nov 12, 2024

こんにちは TAG-さん!

I'm requesting an early TAG design review of Paint/presentation timestamps in performance APIs.

Aligning different paint-related timestamps in all the relevant performance APIs, by having one "interoperable" timestamp and one coarsened platform-specific "VSync" (or "pixels on screen") timestamp.

Further details:

  • I have reviewed the TAG's Web Platform Design Principles
  • The group where the incubation/design work on this is being done (or is intended to be done in the future):
  • The group where standardization of this work is intended to be done ("unknown" if not known):
  • Existing major pieces of multi-implementer review or discussion of this design:
  • Major unresolved issues with or opposition to this design:
  • This work is being funded by:

You should also know that...

This has been discussed in the WebPerfWG in detail over the last 2 years.

Discussions

Log in to see TAG-private discussions.

Discussed Jan 13, 2025 (See Github)

Amy: Both of these aren't very user needs forward. Talks about use cases but not end user experience. Probably implicit because it's performance, but it's useful to have them state that explicitly so we can weigh up tradeoffs

Matthew: second one missing "alternatives considered"

Matthew left a comment

Comment by @matatk Jan 15, 2025 (See Github)

Hi @noamr, thanks for this review request also. We have been discussing paint/presentation timestamps today too, and have a couple of question about the explainer. We would really like to see the (end-)user needs made explicit. We'd also like to know about the alternatives that were considered, and why they found to be unsuitable, again this helps us weigh up the trade-offs. Thank you in advance for any further info you can provide.

Just in case it eases future reference: we put some background info on explainers in the other thread

Discussed Jan 27, 2025 (See Github)

Matthew: both of these (1012 and 1013) we asked for specific bits to be put in the explainer but no reply or updates on either...

Discussed Feb 10, 2025 (See Github)

(still waiting on feedback after we commented, as below)

Discussed Mar 17, 2025 (See Github)

Matthew: Don't enough. It is interesting, and agree it should be more interoperable. Firefox is doing it. Not sure about WebKit. Signs are good. Curiousity is interoperable and implementation-metric. They give an explanation on why interoperable-metric is one or two things. Not sure how interoperable it is. Perhaps @xiaochengh could look into it.

Jeffrey: We should post something about direction looks good. Agree re having xiaochengh a look.

Jeffrey: Hope to post something in plenary.

Comment by @matatk Jul 17, 2025 (See Github)

Hi @noamr. We asked for some additional info in order to complete our review, but we haven't heard back from you, so we're closing this as timed out for now. If you're able to provide the additional info, please re-open, and we'll continue our review.

Discussed Nov 24, 2025 (See Github)

Matthew: they've added some info - just seeing now - will review

Discussed Dec 1, 2025 (See Github)

Matthew: Haven’t made any progress on this, next on my list.

Hadley: Ok on deadlines?

Matthew: From the issue number, it looks like we’re a bit lagging behind. Will look at it.

Discussed Dec 15, 2025 (See Github)

Matthew: They did update their explainer. The alternatives-considered section: there was only one, which is to not-do-this. I'm not sure if we should push harder on that.

Mozilla standards position... their comments were positive. Not sure if it's official. The webkit one was interesting. They were saying this doesn't match the spec. then they updated the spec to match chrome's behaviour, so I don't know if webkit is now not compliant with the spec?

The stuff they have proposed is reasonable. We've discussed it and didn't think it was negative.

I'd like someone else to take a look.

Hadley: Jeffrey is focused on performance.

Matthew: I'll ask him.

Discussed Jan 5, 2026 (See Github)

Xiaocheng: Will look at it until next week.

Discussed Jan 12, 2026 (See Github)

Xiaocheng: Review was posted early, but overlooked it. Definition of when a pixel is painted on a screen is out of scope for web specifications. Seems that we’re introducing something not very useful. The timestamp doesn’t mean much to end users.

Martin: Wonder whether browsers would game the benchmark.

Yves: Wonder if new timings in the rendering pipeline could be used to perform side-channel attacks, e.g. exfiltrate canvas data to someone else.

Lola: Do you want to resolve this as "unsatisfied"?

Xiaocheng: Want to ask for alternatives first.

Lola: Alternatives to?

Xiaocheng: Something that makes more sense to end users. I’ll figure out the wording later.

Lola: Consider this is an early TAG review, so they may not have alternatives yet, and may come back with something different later.

Comment by @xiaochengh Jan 15, 2026 (See Github)

Hi @noamr, the TAG discussed it today and found some new concerns:

We are aware that the "presentation time" is not well defined, and an accurate definition might be out of the scope of the Web specs. However, the "paint time" as how it's currently defined is not perceivable by the end user. It's somewhere in the middle of the entire rendering pipeline, and there might be an arbitrary delay between this and when the pixel actually shows up on the screen. For this reason, we are unsure whether this "paint time" is a good enough performance indicator to add to the platform.

We are also wondering if new timings in the rendering pipeline could be used to perform side-channel attacks, e.g. exfiltrate canvas data to someone else.

Have you considered alternatives that are more interoperable and better match the page performance from the end users' perspective?

Comment by @noamr Jan 15, 2026 (See Github)

Hi @noamr, the TAG discussed it today and found some new concerns:

We are aware that the "presentation time" is not well defined, and an accurate definition might be out of the scope of the Web specs. However, the "paint time" as how it's currently defined is not perceivable by the end user. It's somewhere in the middle of the entire rendering pipeline, and there might be an arbitrary delay between this and when the pixel actually shows up on the screen. For this reason, we are unsure whether this "paint time" is a good enough performance indicator to add to the platform.

It is the latest interoperable timestamp. It gives the developer indications about what they did that could have contributed to a long paint. It is also consistent across different performance entry types (e.g. LCP and LoAF), which allows correlation. It's a very useful timestamp.

Note that most timestamps in existing entries (e.g. resource timing) are not directly reflecting UX, but are used for attribution - finding the root cause for problematic user experience. Paint timing is one of those.

We are also wondering if new timings in the rendering pipeline could be used to perform side-channel attacks, e.g. exfiltrate canvas data to someone else.

Presentation times are heavily coarsened when not in a cross-origin isolated environment for that reason. This is mentioned in the privacy & security section of the explainer.

Have you considered alternatives that are more interoperable and better match the page performance from the end users' perspective?

This has been discussed for about 4 years, see https://github.com/w3c/paint-timing/issues/62. So, yes, we have considered this, and this is the best alternative we could come up with.

Comment by @xiaochengh Jan 22, 2026 (See Github)

Hi @noamr, the TAG discussed it again at a Breakout today. Thanks for addressing our security and privacy concerns!

Regarding the usefulness, we would like to see more evidence. In particular, a study on when the new paint time is and is not a good performance indicator will help a lot. This will also help developers use it correctly.

The thread https://github.com/w3c/paint-timing/issues/62 didn't discuss much about the usefulness, but mainly focused on the technical soundness of the new paint time. And there are obvious scenarios where the new paint time might not be a good performance indicator. For example: image, video, gaming, video conference, ... (and anything with a significant graphics workload in general). We need a more thorough understanding here.

Comment by @mmocny Jan 23, 2026 (See Github)

I agree that https://github.com/w3c/paint-timing/issues/62 doesn't have adequate detail about why we arrived at this specific solution.

For better historical context, I would read through:


But let me also try to summarize the status and value:

  • paintTime is technically not a user perceivable timepoint, and technically only marks an internal scheduling timestamp.
  • It is not quite as valuable as presentationTime, which indeed does better to capture the effects of graphics workload, and is more accurately representative of user experience.
  • However, presentationTime is not interoperably available across all browsers, nor is it strictly better in every way.
    • Chromium has been using this timestamp for various metrics (such as FCP, LCP, Event Timing, etc) for years. Mozilla have signalled a willingness to implement it. Safari has thus far not signalled a willingness to do so.
  • paintTime also offers a unique value relative to presentationTime: it marks the final time point of each animation frame on the main thread.
    • Although there is typically a small amount of extra latency to present the frame (and sometimes a large amount of extra latency), it is useful to know the effect of the main thread in isolation for several reasons:
    • As a performance metric, having both paint and presentation times available you can more easily know if the latency was caused by e.g. javascript or style/layout vs e.g. css effects or decode/rasterization work
    • Beyond that, the paintTime is very useful to segment the overall timeline. E.g. if you want to understand what the state of the DOM was, and which tasks affected a long paint, you need to segment by the main thread time only. Presentation time is an asynchronous value and any main thread updates that overlap with this latency don't directly affect the latency.

There is probably a lot more to be said, or some more presentations to share-- but the real TL;DR is:

  • It helped make performance timeline interoperable (successfully so!)
  • It has proven useful to developers even in implementations that have exposed both values together.