Skip to content

Don't format the generated build script. - #5253

Merged
davidmorgan merged 4 commits into
dart-lang:masterfrom
davidmorgan:wren/no-format
Nov 3, 2026
Merged

davidmorgan merged 4 commits into
dart-lang:masterfrom
davidmorgan:wren/no-format

Conversation

@davidmorgan

@davidmorgan davidmorgan commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Formatting the generated build script turns out to be surprisingly expensive due to JIT compiling the analyzer :)

(this is before we have an AOT build)

So we can gain ~200ms on one dart run build_runner build by simply not formatting it.

@davidmorgan
davidmorgan marked this pull request as ready for review November 2, 2026 09:09
@davidmorgan
davidmorgan requested a review from jensjoha November 2, 2026 09:36
Comment thread build_runner/CHANGELOG.md Outdated
## 2.17.2-wip

- Performance: don't format the generated build script. This saves about
200ms on every build, including no-op builds. The script is marked

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I don't think we should put 200ms here --- it will depend a lot on the machine running it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks, done: the changelog now gives the gain as a percentage of a no-op build, about 15%, measured as 1379 → 1169 ms over 15 alternating runs on one machine.

@davidmorgan
davidmorgan merged commit f3f3fde into dart-lang:master Nov 3, 2026
16 checks passed
@davidmorgan
davidmorgan deleted the wren/no-format branch November 3, 2026 11:00
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

PR Health

Publish ✔️
Package Version Status Publish tag (post-merge)
package:build_runner ⭐ 2.17.2-wip WIP (no publish necessary)
  • 2 already published.
  • 9 WIP (no publish necessary).

Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

This check can be disabled by tagging the PR with skip-publish-check.

Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

This check can be disabled by tagging the PR with skip-changelog-check (for example, for non-user-visible changes when the package version is already at -wip).

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