Skip to content

Conversation

@kenzieschmoll
Copy link
Member

@kenzieschmoll kenzieschmoll commented Apr 21, 2022

import '../../ui/service_extension_widgets.dart';
import 'performance_screen.dart';

class EnhanceTracingButton extends StatelessWidget {
Copy link
Member Author

Choose a reason for hiding this comment

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

this class was moved over from performance_screen.dart with a couple changes (marked below)

SecondaryPerformanceControls.minScreenWidthForTextBeforeScaling,
extensions: [
extensions.profileWidgetBuilds,
extensions.profileUserWidgetBuilds,
Copy link
Member Author

Choose a reason for hiding this comment

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

this line was added

Comment on lines +41 to +45
customExtensionUi: {
extensions.profileWidgetBuilds.extension:
const TrackWidgetBuildsSetting(),
extensions.profileUserWidgetBuilds.extension: const SizedBox(),
},
Copy link
Member Author

Choose a reason for hiding this comment

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

these lines were added

@CoderDake CoderDake self-requested a review April 21, 2022 13:12
Copy link
Contributor

@CoderDake CoderDake left a comment

Choose a reason for hiding this comment

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

I tried my best to look over this, but I think I'm still a bit too green to fully understand and approve this.
That being said I learned a lot reading it, and only found a couple of small things to comment on.

Comment on lines 126 to 129
final _trackWidgetBuildsExtensions = [
extensions.profileWidgetBuilds,
extensions.profileUserWidgetBuilds,
];
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
final _trackWidgetBuildsExtensions = [
extensions.profileWidgetBuilds,
extensions.profileUserWidgetBuilds,
];
final _trackWidgetBuildsExtensions = {
TrackWidgetBuildsScope.all: extensions.profileWidgetBuilds,
TrackWidgetBuildsScope.userCreated: extensions.profileUserWidgetBuilds,
};

Having an ordering depending on the enum value index feels scary at first glance. Perhaps changing this to a map, or setting based on the index explicitly could be less comment dependent approaches.

Copy link
Member Author

Choose a reason for hiding this comment

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

Using a list can save space since with a map, we are keeping a set of keys in memory that we do not actually need. But for this case, since it is small, I have replaced with a map for improved readability.

@kenzieschmoll kenzieschmoll merged commit 666b064 into flutter:master Apr 21, 2022
@kenzieschmoll kenzieschmoll deleted the profileUserWidgets branch April 21, 2022 16:31
@InMatrix
Copy link

How expensive is it to enable TWB for the user code? I wonder if DevTools should just enable it as soon as the user opens the Performance page. Maybe this depends on project size?

@gaaclarke
Copy link
Member

@InMatrix I did a lot of work to try to make it faster to the point were we could enable it by default. The problem is that anytime I made it faster, I also made the baseline faster. The cost varies project to project but in our benchmarks we were seeing a 17% increase in build time with it on: flutter/flutter#100926 (comment)

That makes it not a good candidate to always be on, but maybe you are right that it might make make sense if people are actively looking at performance.

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.

Add a setting to enable debugProfileBuildsEnabledUserWidgets in DevTools

5 participants