Skip to content

Conversation

@flar
Copy link
Contributor

@flar flar commented Aug 29, 2025

We had 2 different implementations of the rendering code for the performance overlay layer. The skia version used some skia-specific code to render the overlay incrementally into an offscreen surface and so we created a different implementation for Impeller that only uses standard rendering calls (and no surface cache). It turns out that the Impeller version was faster anyway even on Skia so it is a simple change to delete the old code and always use the new visualizer.

The new visualizer reduces the time to render the graph from just under 1ms to about .1ms on Skia.
The new visualizer takes .1ms longer to compute on the UI thread, but overall we save time between the 2 threads.
The new visualizer is much faster on Impeller.

Some work could be done to save some of that time on the UI thread by only incrementally updating the graph data, but for now we can take the ~.8-.9ms savings with just some deleted code.

@flar flar requested a review from matanlurey August 29, 2025 05:11
@github-actions github-actions bot added the engine flutter/engine related. See also e: labels. label Aug 29, 2025
@flar
Copy link
Contributor Author

flar commented Aug 29, 2025

I'm expecting I may get golden failures during the testing.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request simplifies the performance overlay implementation by removing the Skia-specific rendering path and exclusively using the DlStopwatchVisualizer. This is a great simplification that removes redundant code and, according to the description, improves performance. The changes are well-contained, and the unit tests have been updated to match the new implementation. I have one minor suggestion to address a potential compiler warning.

@chinmaygarde
Copy link
Member

Are the all the errors goldens related?

@flar
Copy link
Contributor Author

flar commented Sep 29, 2025

They are related to the fact that I changed the algorithm to draw them more clearly (the most recent measurement had always been obscured by the cursor), so they are intentionally different.

I just need to set aside time to reinstall my cloudtop so I can generate the associated new goldens and include them in the PR. Alternately, we can convert this test to use the Skia Gold mechanism so they can be approved from the PR.

github-merge-queue bot pushed a commit that referenced this pull request Oct 2, 2025
(Essentially a re-issue of
#174682 which ended up with
broken Google Testing links)

We had 2 different implementations of the rendering code for the
performance overlay layer. The skia version used some skia-specific code
to render the overlay incrementally into an offscreen surface and so we
created a different implementation for Impeller that only uses standard
rendering calls (and no surface cache). It turns out that the Impeller
version was faster anyway even on Skia so it is a simple change to
delete the old code and always use the new visualizer.

The new visualizer reduces the time to render the graph from just under
1ms to about .1ms on Skia.
The new visualizer takes .1ms longer to compute on the UI thread, but
overall we save time between the 2 threads.
The new visualizer is much faster on Impeller.

Some work could be done to save some of that time on the UI thread by
only incrementally updating the graph data, but for now we can take the
~.8-.9ms savings with just some deleted code.
@flar
Copy link
Contributor Author

flar commented Oct 2, 2025

Superseded by #176364

@flar flar closed this Oct 2, 2025
@flar flar deleted the delete-stopwatch-sk branch October 2, 2025 21:27
mboetger pushed a commit to mboetger/flutter that referenced this pull request Oct 7, 2025
(Essentially a re-issue of
flutter#174682 which ended up with
broken Google Testing links)

We had 2 different implementations of the rendering code for the
performance overlay layer. The skia version used some skia-specific code
to render the overlay incrementally into an offscreen surface and so we
created a different implementation for Impeller that only uses standard
rendering calls (and no surface cache). It turns out that the Impeller
version was faster anyway even on Skia so it is a simple change to
delete the old code and always use the new visualizer.

The new visualizer reduces the time to render the graph from just under
1ms to about .1ms on Skia.
The new visualizer takes .1ms longer to compute on the UI thread, but
overall we save time between the 2 threads.
The new visualizer is much faster on Impeller.

Some work could be done to save some of that time on the UI thread by
only incrementally updating the graph data, but for now we can take the
~.8-.9ms savings with just some deleted code.
okorohelijah pushed a commit to okorohelijah/flutter that referenced this pull request Oct 7, 2025
(Essentially a re-issue of
flutter#174682 which ended up with
broken Google Testing links)

We had 2 different implementations of the rendering code for the
performance overlay layer. The skia version used some skia-specific code
to render the overlay incrementally into an offscreen surface and so we
created a different implementation for Impeller that only uses standard
rendering calls (and no surface cache). It turns out that the Impeller
version was faster anyway even on Skia so it is a simple change to
delete the old code and always use the new visualizer.

The new visualizer reduces the time to render the graph from just under
1ms to about .1ms on Skia.
The new visualizer takes .1ms longer to compute on the UI thread, but
overall we save time between the 2 threads.
The new visualizer is much faster on Impeller.

Some work could be done to save some of that time on the UI thread by
only incrementally updating the graph data, but for now we can take the
~.8-.9ms savings with just some deleted code.
reidbaker pushed a commit to AbdeMohlbi/flutter that referenced this pull request Dec 10, 2025
(Essentially a re-issue of
flutter#174682 which ended up with
broken Google Testing links)

We had 2 different implementations of the rendering code for the
performance overlay layer. The skia version used some skia-specific code
to render the overlay incrementally into an offscreen surface and so we
created a different implementation for Impeller that only uses standard
rendering calls (and no surface cache). It turns out that the Impeller
version was faster anyway even on Skia so it is a simple change to
delete the old code and always use the new visualizer.

The new visualizer reduces the time to render the graph from just under
1ms to about .1ms on Skia.
The new visualizer takes .1ms longer to compute on the UI thread, but
overall we save time between the 2 threads.
The new visualizer is much faster on Impeller.

Some work could be done to save some of that time on the UI thread by
only incrementally updating the graph data, but for now we can take the
~.8-.9ms savings with just some deleted code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine flutter/engine related. See also e: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants