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

Add instrumentation to measure performance and improve UX of snapshotting. #8138

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

polina-c
Copy link
Contributor

@polina-c polina-c commented Aug 2, 2024

No description provided.

@polina-c polina-c requested review from bkonyi, kenzieschmoll and a team as code owners August 2, 2024 02:04
@Playgirlkaybraz11 Playgirlkaybraz11 mentioned this pull request Aug 2, 2024
@@ -86,9 +87,13 @@ class SnapshotDataItem extends SnapshotItem

Future<void> loadHeap(HeapGraphLoader loader) async {
assert(_heap == null);
SnapshotTimer.instance.maybePrint('Loading');
Copy link
Member

Choose a reason for hiding this comment

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

instead of creating a new timer class, we should just record this timing information to our analytics. We could either use the ga.timeAsync methods, or we could create local variables to record the time and then send a single analytics event with the timing profile info.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This class is designed to see numbers for a concrete local experimental run.
Can our analytics be used for this goal?
If yes, where can I find steps?

Copy link
Member

Choose a reason for hiding this comment

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

If the only goal is to add a way to print timing information for local development, then we can use the existing helpers debugTimeSync and debugTimeAsync: https://github.com/flutter/devtools/blob/master/packages/devtools_app/lib/src/shared/development_helpers.dart/#L267-L297

Copy link
Contributor Author

@polina-c polina-c Aug 27, 2024

Choose a reason for hiding this comment

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

These two classes give just one number and require separate function.
I do not want to do refactoring, I want to be able to put checkpoints in any places.
I moved the class DebugTimer to be at the same place as these two, and added documentation.

@polina-c polina-c marked this pull request as draft September 1, 2024 04:02
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