Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the performance of generating a bottom up profile #5533

Merged
merged 2 commits into from
Mar 28, 2023

Conversation

kenzieschmoll
Copy link
Member

@kenzieschmoll kenzieschmoll commented Mar 28, 2023

This improves the performance of generating a bottom up profile by ~60%.

We were using List.remove, which triggered a call to List.copy. This was quite expensive. Now we build up a new list of mergedRoots instead of calling remove on the original list, and call clear + addAll after we are done merging roots.

We also limit the list traversal using a traverseIndex and limit the calls to CpuStackFrame.matches, which can also be expensive for a large N.

Work towards #5091

@kenzieschmoll kenzieschmoll requested a review from a team as a code owner March 28, 2023 00:27
@kenzieschmoll kenzieschmoll requested review from polina-c and removed request for a team March 28, 2023 00:27
Copy link
Contributor

@bkonyi bkonyi left a comment

Choose a reason for hiding this comment

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

Awesome improvement! LGTM!

@kenzieschmoll kenzieschmoll merged commit 35096ba into flutter:master Mar 28, 2023
@kenzieschmoll kenzieschmoll deleted the cpu-perf branch March 28, 2023 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants