Skip to content

[perf] FlutterNewProjectAction stop eager presentation instantiation#8504

Merged
auto-submit[bot] merged 1 commit into
flutter:mainfrom
pq:perf_FlutterNewProject_presentation
Aug 29, 2025
Merged

[perf] FlutterNewProjectAction stop eager presentation instantiation#8504
auto-submit[bot] merged 1 commit into
flutter:mainfrom
pq:perf_FlutterNewProject_presentation

Conversation

@pq
Copy link
Copy Markdown
Collaborator

@pq pq commented Aug 29, 2025

Stop eager presentation instantiation

image

From the inspection:

Any of the constructors of AnAction with parameters instantiate the Presentation object. However, instantiating the Presentation object in constructor results in allocating resources, which may not be necessary. Instead of creating an instance of Presentation that stores text, description, or icon, it is more efficient to utilize no-argument constructors of AnAction and other base classes and follow the convention for setting the text, description, and icon in plugin.xml. The IDE will load text, description, and icon only when the action is actually displayed in the UI.

Confirmed that the label set in plugin.xml is sufficient:

image
  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:

@pq pq requested a review from jwren August 29, 2025 17:03
@pq pq added the autosubmit When this label is applied to a PR, the PR will be submitted as soon as all checks are green. label Aug 29, 2025
@auto-submit auto-submit Bot merged commit 6012641 into flutter:main Aug 29, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit When this label is applied to a PR, the PR will be submitted as soon as all checks are green.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants