Binary AST Proposal: Accelerating JavaScript Parsing Performance

The Binary AST proposal introduces a three‑layer binary encoding for JavaScript abstract syntax trees, aiming to reduce parsing time by up to 90 % and improve web application startup performance, with early prototypes showing promising results and growing community interest.

UC Tech Team
UC Tech Team
UC Tech Team
Binary AST Proposal: Accelerating JavaScript Parsing Performance

WebAssembly is gaining popularity because it can improve application performance and allow source code from other languages to run in browsers.

Large JavaScript applications face a performance bottleneck in parsing the abstract syntax tree (AST). The Binary AST proposal, introduced by engineers from Facebook, Mozilla, and Bloomberg, aims to provide a binary encoding of the AST to speed up parsing.

“Even on a high‑performance laptop, Chrome loading 7 MB of uncompressed JavaScript from Facebook.com can spend about 15 % of CPU time parsing it!”

The proposal defines a three‑layer binary encoding inspired by WebAssembly parsing: simple binary encoding of AST nodes, an additional structural compression layer, and a generic compression algorithm.

Current parsing bottleneck solutions include:

Information that cannot be obtained where needed (often caused by language features such as variable hoisting or built‑in methods).

Early error semantics of JavaScript (requiring pre‑parsing of each file).

Inefficiencies caused by character‑level encoding.

Prototype

The team built an early prototype using Mozilla’s SpiderMonkey engine and reported parsing time reductions of 70‑90 % compared with traditional JavaScript parsing.

In early Facebook.com static news‑feed benchmarks, the Binary AST representation was slightly smaller than raw JavaScript, and parsing speed improvements were significant.

The FAQ explains why native bytecode transmission is not considered and why WebAssembly is not a universal solution.

Community reaction

Interest was first noted at TSConf when TypeScript creator Anders Hejlsberg expressed a desire to improve Binary AST, and later JavaScript creator Brendan Eich voiced cautious optimism.

Conclusion

The Binary AST proposal is one of the most promising ideas for accelerating web performance in recent years; if it matures, the authors intend to adopt it in Dojo.

For organizations seeking help improving web‑app performance, the authors invite contact.

frontendPerformanceJavaScriptParsingWebAssemblyBinary AST
UC Tech Team
Written by

UC Tech Team

We provide high-quality technical articles on client, server, algorithms, testing, data, front-end, and more, including both original and translated content.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.