Regional Director of Engineering
Freelancer.com
@imyoric
... a new over-the-wire format for JavaScript proposed and actively developed by Mozilla that aims to speed up parsing while keeping the semantics of the original JavaScript intact.
Shu-yu Guo
David Teller and Kannan Vijayan
Vladan Djeric
Ingvar Stepanyan
var x;
function f() {
function use_x() {
use(x); // Closes over hoisted var x.
}
var x;
}function h(input) {
var x;
(function() {
eval(input);
})();
}function outer() {
function innerWithSyntaxError() {
var;
}
}(a, {b: c, d}, [e = 1])...(a, {b: c, d}, [e = 1]); // it was an expression(a, {b: c, d}, [e = 1]) => … // it was a parameter listfunction foo(x) {
// No `eval`.
}Names:
- ["foo", ...]
FunctionDeclaration: // 42
name: 0 // 0
eval: false // 0
body: // ...
...Instead of this ...
We store this ...
| Name | Size (kb) | Parse time (average ms) | BinaryAST parse time (average ms) | Diff (%) |
|---|---|---|---|---|
| React | 20 | 0.407 | 0.032 | -92.138 |
| D3 (v5) | 240 | 11.623 | 0.224 | -98.073 |
| Angular | 180 | 7.093 | 0.680 | -90.413 |
| Babel | 780 | 21.100 | 0.895 | -95.758 |
| Backbone | 32 | 0.898 | 0.045 | -94.989 |
Stage 1 proposals represent problems that the committee is interested in spending time exploring solutions to.
Use the static binjs_encode tool from binjs-ref to pre-encode JavaScript files ahead of time
Use a Worker from binast-cf-worker to serve the resulting BinaryAST assets
Go "about:config" and enable unrestricted BinaryAST support via the following options
Improvement as seen by a user on mobile Firefox