-
Notifications
You must be signed in to change notification settings - Fork 566
Open
Labels
Milestone
Description
Part of #10788
Track build-time optimization opportunities for the trimmable type map generation pipeline (GenerateTrimmableTypeMap task).
Current performance (PR #10924 benchmarks, MacBook M1)
| Phase | Avg | P50 | P95 |
|---|---|---|---|
| Scan (8870 types) | 235ms | 224ms | 319ms |
| Emit (typemap assemblies) | 86ms | 75ms | 181ms |
| JCW (315 Java files) | 766ms | 409ms | 3167ms |
| Total cold | 1088ms | 702ms | |
| Total incremental (scan only) | 221ms | 215ms |
Optimization opportunities
- Parallelize JCW source generation — each Java file generation is independent; running them in parallel could significantly reduce the JCW phase which dominates cold build time (suggested by @elinor-fung in [TrimmableTypeMap] Add GenerateTrimmableTypeMap MSBuild task and targets #10924 (comment))
- Parallelize assembly scanning — scanning assemblies for Java peers could be parallelized across assemblies (suggested by @elinor-fung in [TrimmableTypeMap] Add GenerateTrimmableTypeMap MSBuild task and targets #10924 (comment))
- Use MSBuild partial builds — replace the in-task timestamp checking with MSBuild native
Inputs/Outputs1-1 mapping so MSBuild only passes changed assemblies to the task, eliminating the stamp file (suggested by @jonathanpeppers in [TrimmableTypeMap] Add GenerateTrimmableTypeMap MSBuild task and targets #10924 (comment)) - Cache scan results across incremental builds — currently all assemblies are rescanned every build for cross-assembly type resolution; caching the scan index or adding a two-list
Scanoverload could skip unchanged assemblies - Skip unchanged JCW files — avoid writing Java files whose content hasn't changed (attempted but read+compare cost negated savings; may be worth revisiting with content hashing)
Reactions are currently unavailable