[event-timing] Improve grouping by frame index and fix iteration. [chromium/src : main]

0 views
Skip to first unread message

Michal Mocny (Gerrit)

unread,
Feb 16, 2026, 11:30:40 AM (6 days ago) Feb 16
to Scott Haseley, Johannes Henkel, Chromium LUCI CQ, AyeAye, speed-metrics...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org
Attention needed from Johannes Henkel and Scott Haseley

Michal Mocny added 1 comment

File third_party/blink/renderer/core/timing/window_performance.cc
Line 924, Patchset 11 (Latest): event_timing_entries_.clear();
Michal Mocny . resolved

Just because we might be in the middle of a stack with multiple event timing processing, it might be best not to touch this vector.

We don't call ReportEventTiming() from processing in this patch, but there is an upcoming change that will add that...

Open in Gerrit

Related details

Attention is currently required from:
  • Johannes Henkel
  • Scott Haseley
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia33d7dd1e58c7d2298c52b390218f3246a6a6964
Gerrit-Change-Number: 7580513
Gerrit-PatchSet: 11
Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
Gerrit-Attention: Scott Haseley <shas...@chromium.org>
Gerrit-Comment-Date: Mon, 16 Feb 2026 16:30:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Johannes Henkel (Gerrit)

unread,
Feb 17, 2026, 5:09:53 PM (4 days ago) Feb 17
to Michal Mocny, Scott Haseley, Chromium LUCI CQ, AyeAye, speed-metrics...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org
Attention needed from Michal Mocny and Scott Haseley

Johannes Henkel added 6 comments

File third_party/blink/renderer/core/timing/performance_event_timing.h
Line 46, Patchset 11 (Latest): uint64_t frame_index = 0;
Johannes Henkel . unresolved

Is it worthwhile saying somewhere what is the smallest "real" frame index that we expect?

Line 44, Patchset 11 (Latest): // Presentation promise index in which the entry in |event_timing_| was
// added.
Johannes Henkel . unresolved

Is this comment out of date?

File third_party/blink/renderer/core/timing/window_performance.h
Line 275, Patchset 11 (Latest): uint64_t current_frame_index_ = 1;
Johannes Henkel . unresolved

From this, I gather that the smallest 'real' frame index may be 1, is that right?

File third_party/blink/renderer/core/timing/window_performance.cc
Line 646, Patchset 11 (Latest): entry->GetEventTimingReportingInfo()->frame_index = current_frame_index_;
Johannes Henkel . unresolved

Would it be possible to set frame_index on reporting_info prior to PerformanceEventTiming::Create?

If so, it seems that reporting_info is a local variable, so it could be more efficient to std::move it when ::Create is getting called actually - I think we're making a copy then, right now?

Line 870, Patchset 11 (Latest): current_frame_index_++;
Johannes Henkel . unresolved

I'm a bit surprised this happens in this method. Doesn't this mean that only when there are event timings without next paint (this method is invoked conditionally) will the thingy get incremented?

It would be more expected to have this increment in the caller of this method?

I see there's already another one in OnPaintFinished.

Line 945, Patchset 11 (Latest): UNSAFE_BUFFERS(base::span(all_entries.begin(), end_of_frame_it));
Johannes Henkel . unresolved

I wonder if this could be done with subspan instead, without requiring the allcaps UNSAFE.

If this std::ranges thingy in l. 940 could be reformulated to directly produce the length of the subspan (maybe a loop that computes a size_t length of sorts), the frame_entries could just be all_entries.subspan(length)?

Open in Gerrit

Related details

Attention is currently required from:
  • Michal Mocny
  • Scott Haseley
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia33d7dd1e58c7d2298c52b390218f3246a6a6964
    Gerrit-Change-Number: 7580513
    Gerrit-PatchSet: 11
    Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-Attention: Scott Haseley <shas...@chromium.org>
    Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
    Gerrit-Comment-Date: Tue, 17 Feb 2026 22:09:47 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Scott Haseley (Gerrit)

    unread,
    Feb 17, 2026, 6:35:59 PM (4 days ago) Feb 17
    to Michal Mocny, Johannes Henkel, Chromium LUCI CQ, AyeAye, speed-metrics...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org
    Attention needed from Michal Mocny

    Scott Haseley added 10 comments

    Patchset-level comments
    File-level comment, Patchset 11 (Latest):
    Scott Haseley . resolved

    Okay I think this all makes sense to me. Sending some minor feedback, I want to read through one more tomorrow with fresh eyes before I +1.

    File third_party/blink/renderer/core/timing/window_performance.cc
    Line 645, Patchset 11 (Latest): DCHECK(entry);
    Scott Haseley . unresolved

    nit: DCHECK probably not needed since allocation failure will crash.

    Line 773, Patchset 11 (Latest): // TODO(crbug.com/378647854): Move this to happen before we request
    Scott Haseley . resolved

    (Aside: this feels very brittle, since this races with `current_frame_index_` getting updated. Or maybe it isn't in practice since the promise is likely to run before the next input?).

    Line 870, Patchset 11 (Latest): current_frame_index_++;
    Johannes Henkel . unresolved

    I'm a bit surprised this happens in this method. Doesn't this mean that only when there are event timings without next paint (this method is invoked conditionally) will the thingy get incremented?

    It would be more expected to have this increment in the caller of this method?

    I see there's already another one in OnPaintFinished.

    Scott Haseley

    I think to hit this code it requires getting a presentation time callback _without_ a paint, in which case we set a more appropriate timestamp. And since we've "handled" all of the event timing entries for the current "frame", we need to increment this to make those eligible to be emitted (plus we're done with that group)?

    This is probably worth a comment, but IIUC it makes sense/is needed.

    Line 924, Patchset 11 (Latest): event_timing_entries_.clear();
    Michal Mocny . unresolved

    Just because we might be in the middle of a stack with multiple event timing processing, it might be best not to touch this vector.

    We don't call ReportEventTiming() from processing in this patch, but there is an upcoming change that will add that...

    Scott Haseley

    Can you remind me -- why does the CHECK no longer apply?

    Line 934, Patchset 11 (Latest): while (!event_timing_entries_.empty()) {
    Scott Haseley . resolved

    Not for this patch, but I wonder if this things would be a bit cleaner with a different data structure? Either a HeapDeque<> if we're always removing from the front and appending to the back, or maybe better yet a list of Vectors, one per each frame (or a list of PerFrameEventTimingData, each of which contains a list)?

    Line 945, Patchset 11 (Latest): UNSAFE_BUFFERS(base::span(all_entries.begin(), end_of_frame_it));
    Johannes Henkel . unresolved

    I wonder if this could be done with subspan instead, without requiring the allcaps UNSAFE.

    If this std::ranges thingy in l. 940 could be reformulated to directly produce the length of the subspan (maybe a loop that computes a size_t length of sorts), the frame_entries could just be all_entries.subspan(length)?

    Scott Haseley

    +1. I don't know enough about spans, but IIUC this is meant to be temporary until usages are fixed: https://source.chromium.org/chromium/chromium/src/+/main:base/compiler_specific.h;l=1044-1047;drc=6d3e2ca997ca3ef995f719b22a1658a250a22d1e;bpv=1;bpt=1

    Line 947, Patchset 11 (Latest): // Unless ALL events in this range are ready to be reported, break out. //
    Scott Haseley . unresolved

    nit: Some stray slashes got in there

    ```suggestion
    // Unless ALL events in this range are ready to be reported, break out.
    ```
    Line 1421, Patchset 11 (Latest): DCHECK(entry);
    Scott Haseley . unresolved

    nit: CHECK?

    Line 1564, Patchset 11 (Latest): // frame group is now eligible for reporting (even if it didn't request a
    Scott Haseley . unresolved

    It took me a bit to understand why calling ReportEventTimings here is both okay and needed. IIUC in some cases events set a fallback time during processing (rare -- Mac only for artificial pointer ups [1], and that's why this is needed?). And also, if there are other events ahead of it in the queue waiting on presentation time, they'll have to wait until then.

    I think maybe expanding the comment to indicate which event timings are expected to be reported would be helpful, since the current frame group being eligible here to actually be reported is expected to be rare (and was messing up my mental model!)?

    [1]https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/timing/window_performance.cc;l=689-694;drc=6d3e2ca997ca3ef995f719b22a1658a250a22d1e;bpv=1;bpt=1

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Michal Mocny
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia33d7dd1e58c7d2298c52b390218f3246a6a6964
    Gerrit-Change-Number: 7580513
    Gerrit-PatchSet: 11
    Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
    Gerrit-Comment-Date: Tue, 17 Feb 2026 23:35:50 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Johannes Henkel <joha...@chromium.org>
    Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Michal Mocny (Gerrit)

    unread,
    Feb 17, 2026, 6:41:34 PM (4 days ago) Feb 17
    to Scott Haseley, Johannes Henkel, Chromium LUCI CQ, AyeAye, speed-metrics...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org
    Attention needed from Johannes Henkel

    Michal Mocny added 5 comments

    File third_party/blink/renderer/core/timing/performance_event_timing.h
    Line 46, Patchset 11 (Latest): uint64_t frame_index = 0;
    Johannes Henkel . unresolved

    Is it worthwhile saying somewhere what is the smallest "real" frame index that we expect?

    Michal Mocny

    Yes, but, I also think its not worth investing too much time into extensive documentation because the goal is to replace manual tracking with PaintTimingMixin. We probably will have SOME frame_index still, just like the paint records, so I'll add a brief note.

    File third_party/blink/renderer/core/timing/window_performance.h
    Line 275, Patchset 11 (Latest): uint64_t current_frame_index_ = 1;
    Johannes Henkel . unresolved

    From this, I gather that the smallest 'real' frame index may be 1, is that right?

    Michal Mocny

    Correct-- I will update docs.

    File third_party/blink/renderer/core/timing/window_performance.cc
    Line 646, Patchset 11 (Latest): entry->GetEventTimingReportingInfo()->frame_index = current_frame_index_;
    Johannes Henkel . unresolved

    Would it be possible to set frame_index on reporting_info prior to PerformanceEventTiming::Create?

    If so, it seems that reporting_info is a local variable, so it could be more efficient to std::move it when ::Create is getting called actually - I think we're making a copy then, right now?

    Michal Mocny

    oh yeah, for sure we can, I love that suggestion, will change.

    Line 870, Patchset 11 (Latest): current_frame_index_++;
    Johannes Henkel . unresolved

    I'm a bit surprised this happens in this method. Doesn't this mean that only when there are event timings without next paint (this method is invoked conditionally) will the thingy get incremented?

    It would be more expected to have this increment in the caller of this method?

    I see there's already another one in OnPaintFinished.

    Michal Mocny

    Yes, there are exactly two places where this increments (as you notice):

    • OnPaintFinished
    • Here, which is the "early end" of a "frame" that doesn't need next paint.

    Conceptually this matches the LoAF model of "Task or Frame".

    We only get to ReportEventTimingsWithoutNextPaint at the end of a bunch of event dispatch so not after every single event.

    However, the specific hooks will change a bit to make this all less confusing as we adopt PaintTimingMixin and TaskTimeObserver (But I've put a hold on that integration until we finish this batch of cleanup)

    Line 945, Patchset 11 (Latest): UNSAFE_BUFFERS(base::span(all_entries.begin(), end_of_frame_it));
    Johannes Henkel . unresolved

    I wonder if this could be done with subspan instead, without requiring the allcaps UNSAFE.

    If this std::ranges thingy in l. 940 could be reformulated to directly produce the length of the subspan (maybe a loop that computes a size_t length of sorts), the frame_entries could just be all_entries.subspan(length)?

    Michal Mocny

    I did have a version that did that, but it just felt convoluted to basically create a range, find the end fo the range, count the entries in that sub-range, then count subspan.

    Doing it that way "tricks" the compiler/linter from giving us a warning, but its JUST the same iterator operations + extra steps. I was weary of this big scary warning, but I saw a bunch of similar usage in the code.

    Perhaps Scott has a suggestion.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Johannes Henkel
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia33d7dd1e58c7d2298c52b390218f3246a6a6964
    Gerrit-Change-Number: 7580513
    Gerrit-PatchSet: 11
    Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
    Gerrit-Comment-Date: Tue, 17 Feb 2026 23:41:29 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Michal Mocny (Gerrit)

    unread,
    Feb 18, 2026, 3:02:01 PM (4 days ago) Feb 18
    to Scott Haseley, Johannes Henkel, Chromium LUCI CQ, AyeAye, speed-metrics...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org
    Attention needed from Johannes Henkel and Scott Haseley

    Michal Mocny added 13 comments

    Patchset-level comments
    Michal Mocny . resolved

    Patch incoming, comments first.

    Ty for amazing insights!

    File third_party/blink/renderer/core/timing/performance_event_timing.h
    Line 46, Patchset 11 (Latest): uint64_t frame_index = 0;
    Johannes Henkel . resolved

    Is it worthwhile saying somewhere what is the smallest "real" frame index that we expect?

    Michal Mocny

    Yes, but, I also think its not worth investing too much time into extensive documentation because the goal is to replace manual tracking with PaintTimingMixin. We probably will have SOME frame_index still, just like the paint records, so I'll add a brief note.

    Michal Mocny

    Done

    Line 44, Patchset 11 (Latest): // Presentation promise index in which the entry in |event_timing_| was
    // added.
    Johannes Henkel . resolved

    Is this comment out of date?

    Michal Mocny

    Done

    File third_party/blink/renderer/core/timing/window_performance.h
    Line 275, Patchset 11 (Latest): uint64_t current_frame_index_ = 1;
    Johannes Henkel . resolved

    From this, I gather that the smallest 'real' frame index may be 1, is that right?

    Michal Mocny

    Correct-- I will update docs.

    Michal Mocny

    Done

    File third_party/blink/renderer/core/timing/window_performance.cc
    Scott Haseley . resolved

    nit: DCHECK probably not needed since allocation failure will crash.

    Michal Mocny

    Done

    Line 646, Patchset 11 (Latest): entry->GetEventTimingReportingInfo()->frame_index = current_frame_index_;
    Johannes Henkel . resolved

    Would it be possible to set frame_index on reporting_info prior to PerformanceEventTiming::Create?

    If so, it seems that reporting_info is a local variable, so it could be more efficient to std::move it when ::Create is getting called actually - I think we're making a copy then, right now?

    Michal Mocny

    oh yeah, for sure we can, I love that suggestion, will change.

    Michal Mocny

    I also did the same for is_processing_fully_nested_in_another_event, sweet.

    Line 773, Patchset 11 (Latest): // TODO(crbug.com/378647854): Move this to happen before we request
    Scott Haseley . resolved

    (Aside: this feels very brittle, since this races with `current_frame_index_` getting updated. Or maybe it isn't in practice since the promise is likely to run before the next input?).

    Michal Mocny

    I think this doesn't race, but I agree that this is terrible (and gets removed with PaintTimingMixin).

    At the [end of Event Dispatch](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/widget/input/widget_input_handler_manager.cc;l=485-491) we manually "break" the swap promise which synchronously calls the presentation time, and this logic is what we use to detect that this happens. We must have a different frame_index_ if we're "after paint', and must have the same index if we are still "before paint".

    Older documentation here might be a good quick read? https://docs.google.com/document/d/1fsCbKdMwtqMObzILXKO6Us5v22W9RJloyBq_Qf0jc8Q

    Line 870, Patchset 11 (Latest): current_frame_index_++;
    Johannes Henkel . resolved

    I'm a bit surprised this happens in this method. Doesn't this mean that only when there are event timings without next paint (this method is invoked conditionally) will the thingy get incremented?

    It would be more expected to have this increment in the caller of this method?

    I see there's already another one in OnPaintFinished.

    Michal Mocny

    Yes, there are exactly two places where this increments (as you notice):

    • OnPaintFinished
    • Here, which is the "early end" of a "frame" that doesn't need next paint.

    Conceptually this matches the LoAF model of "Task or Frame".

    We only get to ReportEventTimingsWithoutNextPaint at the end of a bunch of event dispatch so not after every single event.

    However, the specific hooks will change a bit to make this all less confusing as we adopt PaintTimingMixin and TaskTimeObserver (But I've put a hold on that integration until we finish this batch of cleanup)

    Michal Mocny

    Done

    Line 924, Patchset 11 (Latest): event_timing_entries_.clear();
    Michal Mocny . resolved

    Just because we might be in the middle of a stack with multiple event timing processing, it might be best not to touch this vector.

    We don't call ReportEventTiming() from processing in this patch, but there is an upcoming change that will add that...

    Scott Haseley

    Can you remind me -- why does the CHECK no longer apply?

    Michal Mocny

    I think that in this patch it is fine, but in a future patch I call ReportEventTimings() from more places, including in the middle of event dispatch (for cases where we get a fallback earlier, such as js prompts or contextmenu events).

    And, since you can detach window from an earlier event in the same task, this problem came up again.

    I could defer this change to the CL that needs it, but i though this was a good safeguard and worth keeping together.

    ---

    I can adjust to ensure all callers check this first, adn add the check there.

    Line 934, Patchset 11 (Latest): while (!event_timing_entries_.empty()) {
    Scott Haseley . resolved

    Not for this patch, but I wonder if this things would be a bit cleaner with a different data structure? Either a HeapDeque<> if we're always removing from the front and appending to the back, or maybe better yet a list of Vectors, one per each frame (or a list of PerFrameEventTimingData, each of which contains a list)?

    Michal Mocny

    I think I tried HeapDeque but its not contiguous so it made it not possible to use spans for grame-group iterateion.

    ---

    Yeah a queue of vectors, for each unique frame group, would be my preferred option-- but usually we dont have such a deep queue. Also maybe there is a way to consolidate this pattern with all the per-paint detectors...

    But not for this patch!

    Line 947, Patchset 11 (Latest): // Unless ALL events in this range are ready to be reported, break out. //
    Scott Haseley . resolved

    nit: Some stray slashes got in there

    ```suggestion
    // Unless ALL events in this range are ready to be reported, break out.
    ```
    Michal Mocny

    Done

    Scott Haseley . resolved

    nit: CHECK?

    Michal Mocny

    Ive just gone ahead and updated all the DCHECKs related to Evernt Timing to CHECK.

    There are a lot more DCHECKS in this file tho.

    Line 1564, Patchset 11 (Latest): // frame group is now eligible for reporting (even if it didn't request a
    Scott Haseley . resolved

    It took me a bit to understand why calling ReportEventTimings here is both okay and needed. IIUC in some cases events set a fallback time during processing (rare -- Mac only for artificial pointer ups [1], and that's why this is needed?). And also, if there are other events ahead of it in the queue waiting on presentation time, they'll have to wait until then.

    I think maybe expanding the comment to indicate which event timings are expected to be reported would be helpful, since the current frame group being eligible here to actually be reported is expected to be rare (and was messing up my mental model!)?

    [1]https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/timing/window_performance.cc;l=689-694;drc=6d3e2ca997ca3ef995f719b22a1658a250a22d1e;bpv=1;bpt=1

    Michal Mocny

    This didn't used to flush and I think I can remove this change here now.

    One new fallback was added recently `FallbackReason::kWindowDestroyed` and when that happens we exit early without requesting presetation, and probably this should end the current frame and report event timings--

    But right now the layering is weird: ProcessingEnd may still be in the middle of a task with more events on the stack, so I dont want to touch the frame_index there, and also I dont want to start reporting these right there.

    But also in that case we almost certainly wont paint again?

    ---

    I think the answer is to leave it as is, potentially fix when adopting TaskTimeObserver.

    ---

    Also, in an upcominng patch, I change when we check and assign Fallback times to be more eager so we dont request presentation time when we know we dont need one just to override it. When I do that, I also flush timings-- though I might need to rethink some of that in light of the above insights...

    For now-- removing this as not really needed.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Johannes Henkel
    • Scott Haseley
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia33d7dd1e58c7d2298c52b390218f3246a6a6964
    Gerrit-Change-Number: 7580513
    Gerrit-PatchSet: 11
    Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
    Gerrit-Attention: Scott Haseley <shas...@chromium.org>
    Gerrit-Comment-Date: Wed, 18 Feb 2026 20:01:55 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Johannes Henkel <joha...@chromium.org>
    Comment-In-Reply-To: Scott Haseley <shas...@chromium.org>
    Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Michal Mocny (Gerrit)

    unread,
    Feb 18, 2026, 4:14:11 PM (3 days ago) Feb 18
    to Scott Haseley, Johannes Henkel, Chromium LUCI CQ, AyeAye, speed-metrics...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org
    Attention needed from Johannes Henkel and Scott Haseley

    Michal Mocny added 1 comment

    File third_party/blink/renderer/core/timing/window_performance.cc
    Line 945, Patchset 11: UNSAFE_BUFFERS(base::span(all_entries.begin(), end_of_frame_it));
    Johannes Henkel . resolved

    I wonder if this could be done with subspan instead, without requiring the allcaps UNSAFE.

    If this std::ranges thingy in l. 940 could be reformulated to directly produce the length of the subspan (maybe a loop that computes a size_t length of sorts), the frame_entries could just be all_entries.subspan(length)?

    Michal Mocny

    I did have a version that did that, but it just felt convoluted to basically create a range, find the end fo the range, count the entries in that sub-range, then count subspan.

    Doing it that way "tricks" the compiler/linter from giving us a warning, but its JUST the same iterator operations + extra steps. I was weary of this big scary warning, but I saw a bunch of similar usage in the code.

    Perhaps Scott has a suggestion.

    Michal Mocny

    You were right... you were right :)

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Johannes Henkel
    • Scott Haseley
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ia33d7dd1e58c7d2298c52b390218f3246a6a6964
      Gerrit-Change-Number: 7580513
      Gerrit-PatchSet: 13
      Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
      Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
      Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
      Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
      Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
      Gerrit-Attention: Scott Haseley <shas...@chromium.org>
      Gerrit-Comment-Date: Wed, 18 Feb 2026 21:14:06 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Johannes Henkel <joha...@chromium.org>
      Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Michal Mocny (Gerrit)

      unread,
      Feb 18, 2026, 5:11:46 PM (3 days ago) Feb 18
      to Scott Haseley, Johannes Henkel, Chromium LUCI CQ, AyeAye, speed-metrics...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org
      Attention needed from Johannes Henkel and Scott Haseley

      Michal Mocny voted Auto-Submit+1

      Auto-Submit+1
      Gerrit-Comment-Date: Wed, 18 Feb 2026 22:11:42 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Johannes Henkel (Gerrit)

      unread,
      Feb 18, 2026, 5:26:10 PM (3 days ago) Feb 18
      to Michal Mocny, Scott Haseley, Chromium LUCI CQ, AyeAye, speed-metrics...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org
      Attention needed from Michal Mocny and Scott Haseley

      Johannes Henkel voted and added 2 comments

      Votes added by Johannes Henkel

      Code-Review+1

      2 comments

      Patchset-level comments
      File-level comment, Patchset 13 (Latest):
      Johannes Henkel . resolved

      Looks sweet!
      Feel free to skip the trivial typo there.

      File third_party/blink/renderer/core/timing/performance_event_timing.h
      Line 44, Patchset 12: // |frane_index| in which the entry in |event_timing_| was first created.
      Johannes Henkel . unresolved

      typo: frame_index

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Michal Mocny
      • Scott Haseley
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ia33d7dd1e58c7d2298c52b390218f3246a6a6964
        Gerrit-Change-Number: 7580513
        Gerrit-PatchSet: 13
        Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
        Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
        Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
        Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
        Gerrit-Attention: Scott Haseley <shas...@chromium.org>
        Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
        Gerrit-Comment-Date: Wed, 18 Feb 2026 22:25:55 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Michal Mocny (Gerrit)

        unread,
        Feb 18, 2026, 5:27:29 PM (3 days ago) Feb 18
        to Johannes Henkel, Scott Haseley, Chromium LUCI CQ, AyeAye, speed-metrics...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org
        Attention needed from Scott Haseley

        Michal Mocny added 2 comments

        Patchset-level comments
        Michal Mocny . resolved

        (resolving the typo comment to save another round of uploading and cq, but waiting for scott to sign off). Can fix typo in subsequent cl.

        File third_party/blink/renderer/core/timing/performance_event_timing.h
        Line 44, Patchset 12: // |frane_index| in which the entry in |event_timing_| was first created.
        Johannes Henkel . resolved

        typo: frame_index

        Michal Mocny

        Acknowledged

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Scott Haseley
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: Ia33d7dd1e58c7d2298c52b390218f3246a6a6964
          Gerrit-Change-Number: 7580513
          Gerrit-PatchSet: 13
          Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
          Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
          Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
          Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
          Gerrit-Attention: Scott Haseley <shas...@chromium.org>
          Gerrit-Comment-Date: Wed, 18 Feb 2026 22:27:22 +0000
          satisfied_requirement
          open
          diffy

          Scott Haseley (Gerrit)

          unread,
          Feb 18, 2026, 6:44:08 PM (3 days ago) Feb 18
          to Michal Mocny, Johannes Henkel, Chromium LUCI CQ, AyeAye, speed-metrics...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org
          Attention needed from Michal Mocny

          Scott Haseley voted and added 1 comment

          Votes added by Scott Haseley

          Code-Review+1
          Commit-Queue+2

          1 comment

          Patchset-level comments
          Scott Haseley . resolved

          LGTM

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Michal Mocny
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: Ia33d7dd1e58c7d2298c52b390218f3246a6a6964
          Gerrit-Change-Number: 7580513
          Gerrit-PatchSet: 13
          Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
          Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
          Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
          Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
          Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
          Gerrit-Comment-Date: Wed, 18 Feb 2026 23:43:57 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          open
          diffy

          Chromium LUCI CQ (Gerrit)

          unread,
          Feb 18, 2026, 6:48:28 PM (3 days ago) Feb 18
          to Michal Mocny, Scott Haseley, Johannes Henkel, AyeAye, speed-metrics...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org

          Chromium LUCI CQ submitted the change

          Change information

          Commit message:
          [event-timing] Improve grouping by frame index and fix iteration.

          This patch refactors how EventTiming groups events for reporting by
          replacing 'presentation_index' with a 'frame_index'. The primary
          difference is that all events are immediately assigned to a frame group
          at processing start, rather than after processing end. Events will now
          always group into frames, even without requests for presentation time.
          And, we can more carefully and conditionally request presentation time
          only when we need it.

          This new model is a step towards PaintTimingMixin and prepares for some
          more feature work that benefits from easier per-animation-frame
          interaction.

          Key improvements:
          - Assign frame_index immediately and consistently.
          - Decouple Presentation Requests: Limits presentation time requests to only when an event actually requires visual feedback.
          - Safer Buffer Management: Refactored reporting loops to use base::span and indices, eliminating unsafe raw iterator arithmetic.
          - Robust Metric Calculation: Fixes a pre-existing bug where TotalNonOverlappingProcessingDuration was calculated using all pending events instead of just the current frame's events.
          - Hardened Lifecycle: Added validation checks to ensure presentation time is only assigned to events that completed the rendering pipeline.
          Bug: 328902994, 378647854
          Change-Id: Ia33d7dd1e58c7d2298c52b390218f3246a6a6964
          Reviewed-by: Johannes Henkel <joha...@chromium.org>
          Reviewed-by: Scott Haseley <shas...@chromium.org>
          Commit-Queue: Scott Haseley <shas...@chromium.org>
          Auto-Submit: Michal Mocny <mmo...@chromium.org>
          Cr-Commit-Position: refs/heads/main@{#1586740}
          Files:
          • M third_party/blink/renderer/core/timing/performance_event_timing.h
          • M third_party/blink/renderer/core/timing/window_performance.cc
          • M third_party/blink/renderer/core/timing/window_performance.h
          • M third_party/blink/renderer/core/timing/window_performance_test.cc
          Change size: L
          Delta: 4 files changed, 175 insertions(+), 157 deletions(-)
          Branch: refs/heads/main
          Submit Requirements:
          • requirement satisfiedCode-Review: +1 by Johannes Henkel, +1 by Scott Haseley
          Open in Gerrit
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: merged
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: Ia33d7dd1e58c7d2298c52b390218f3246a6a6964
          Gerrit-Change-Number: 7580513
          Gerrit-PatchSet: 14
          Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
          Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
          open
          diffy
          satisfied_requirement
          Reply all
          Reply to author
          Forward
          0 new messages