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

Performance improvements for the CPU profiler #3274

Merged
merged 2 commits into from
Aug 13, 2021

Conversation

kenzieschmoll
Copy link
Member

The recent introduction of profile filtering added more calls to getSimplePackageUrl than we would have liked. This PR improves the performance of the profiler by caching some values:

  • the processedUrl returned by getSimplePackageUrl for a stack frame. We then pass this value as a parameter during stack frame copy operations (we were previously computing it for every copy, which is unnecessary).
  • the isNative, isDartCore, and isFlutterCore values for a single stack frame. These no longer have to be re-computed for filter operations.


bool get isFlutterCore =>
_isFlutterCore ??= processedUrl.startsWith('package:flutter/') ||
name.startsWith('flutter::') ||
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: maybe make these constants so you have an easy place to document that
flutter:: is the Flutter namespace in C++?

Copy link
Contributor

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

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

lgtm

@kenzieschmoll kenzieschmoll merged commit 3e8dbe3 into flutter:master Aug 13, 2021
@kenzieschmoll kenzieschmoll deleted the profile-filters branch August 13, 2021 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants