Skip to content

Conversation

@davidmorgan
Copy link
Contributor

@davidmorgan davidmorgan commented Oct 16, 2025

Add an alternative compile path using AOT, don't try to automatically switch to it yet, just add flags.

Small change to make AOT compile work: pass the package config to the child process, the AOT snapshot doesn't have that available.

Add basic end to end test coverage.

As expected startup is a lot faster

JIT
> edit-benchmark; dart run build_runner build
2s built_value_generator:built_value on 1001 inputs: 998 skipped, 1 not triggered, 2 same; spent 1s analyzing                                                                                                                                                 
1s source_gen:combining_builder on 1001 inputs: 999 skipped, 2 same; spent 1s tracking                                                                                                                                                                        
                                                                                                                                                                                                                                                              
Built with build_runner/jit in 5s; wrote 4 outputs.

AOT
> edit-benchmark; dart run build_runner build --force-aot
0s built_value_generator:built_value on 1001 inputs: 998 skipped, 1 not triggered, 2 same                                                                                                                                                                     
1s source_gen:combining_builder on 1001 inputs: 999 skipped, 2 same                                                                                                                                                                                           
                                                                                                                                                                                                                                                              
Built with build_runner/aot in 1s; wrote 4 outputs.

and throughput

JIT
> edit-benchmark; dart run build_runner build
38s built_value_generator:built_value on 5001 inputs: 1 not triggered, 5000 same; spent 20s analyzing, 15s building, 1s resolving                                                                                                                             
42s source_gen:combining_builder on 5001 inputs: 1 skipped, 5000 same; spent 19s building, 17s tracking, 5s analyzing                                                                                                                                         
                                                                                                                                                                                                                                                              
Built with build_runner/jit in 84s; wrote 10000 outputs.

AOT
23s built_value_generator:built_value on 5001 inputs: 1 not triggered, 5000 same; spent 11s analyzing, 10s building                                                                                                                                           
30s source_gen:combining_builder on 5001 inputs: 1 skipped, 5000 same; spent 14s tracking, 12s building, 5s analyzing                                                                                                                                         
                                                                                                                                                                                                                                                              
Built with build_runner/aot in 56s; wrote 10000 outputs.

@github-actions
Copy link

github-actions bot commented Oct 16, 2025

PR Health

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.

@davidmorgan davidmorgan requested a review from jensjoha October 20, 2025 10:39
@davidmorgan davidmorgan marked this pull request as ready for review October 20, 2025 10:39
@davidmorgan davidmorgan merged commit ce2491c into dart-lang:master Oct 20, 2025
36 checks passed
@davidmorgan davidmorgan deleted the compile-aot branch October 20, 2025 11:54
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