Conditional Execution of Transpiler Passes Based on Per-Script Feature Detection
summary
A compile-time change implemented in Google Closure Compiler tracks features per script as a per-script feature bitmask and lets each transpiler pass query that mask and skip full AST traversals when its target features are absent. Passes update the dynamic feature set to preserve downward monotonicity, and safeguards include pass order assertions, a dev-mode AST validator, and a post-transpile check. Evaluation on large Google apps shows 30–40% fewer transpiler traversals and roughly 50% faster transpilation across the fleet.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 1:04JavaScript evolution needs
- 4:36Why transpilation is costly
- 8:51Optimizing transpiler passes
- 10:15Feature-based pass skipping
- 12:01Legacy vs optimized flow
- 13:28Preventing feature leakage
- 15:14Performance improvements
- 16:17Limitations and future work
- 17:41Key takeaways
related talks
19mFeature-Sensitive Coverage for Conformance Testing of Programming Language Implementations
26mPerformance of feature detection
26mBack to the Future of JS II
22mBeacons: An End-to-End Compiler Framework for Predicting and Utilizing Dynamic ...
25mBack to the future of JS II: Beyond what we can foresee
30mOn Automating Hybrid Execution of Ahead-of-Time and Just-in-Time Compiled Code
25mHybrid Execution: Combining Ahead-of-Time and Just-in-Time Compilation
19mCausalTuner: Feature-Aware Causal Guidance for Compiler Auto-tuning
