You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR pulls in some still-experimental work to partially evaluate the SpiderMonkey JS interpreter together with JS scripts, ahead-of-time, to produce compiled code.
It should not yet be considered production-worthy, pending more testing and proving out its stability and performance; but, it is at a point where we believe it should be under a non-default option so that users of the SDK may try it. No guarantees! It may explode your bytecode!
The support works by bundling two builds of the engine Wasm -- with and without the weval intrinsics -- and invoking either Wizer with the "normal" build or weval with the "weval" build, as appropriate. The --enable-weval option selects the latter.
I have measured weval showing speedups of ~30% on a Markdown renderer on my machine, and up to ~3.5x on the crypto benchmark in the Octane suite (1.83x speedup geomean).
I'm not entirely sure about some of the build/packaging integration; that's the bulk of the changes here and will need special review.
The package deps include @cfallin/weval; if it's preferable, I should probably move the repo to BA and get the appropriate permissions to publish it as @bytecodealliance/weval.
The reason will be displayed to describe this comment to others. Learn more.
A standard technique for lazy initialization in JavaScript would be to turn this into a dynamic import() nested into the async code path where Weval is used only.
This PR pulls in some still-experimental work to partially evaluate the SpiderMonkey JS interpreter together with JS scripts, ahead-of-time, to produce compiled code.
It should not yet be considered production-worthy, pending more testing and proving out its stability and performance; but, it is at a point where we believe it should be under a non-default option so that users of the SDK may try it. No guarantees! It may explode your bytecode!
The support works by bundling two builds of the engine Wasm -- with and without the weval intrinsics -- and invoking either Wizer with the "normal" build or weval with the "weval" build, as appropriate. The
--enable-weval
option selects the latter.I have measured weval showing speedups of ~30% on a Markdown renderer on my machine, and up to ~3.5x on the
crypto
benchmark in the Octane suite (1.83x speedup geomean).This refers to a hash for the
runtime/spidermonkey
submodule that is in fastly/spidermonkey-wasi-embedding#17; that will need to be merged first (and probably bytecodealliance/gecko-dev#5 before that).I'm not entirely sure about some of the build/packaging integration; that's the bulk of the changes here and will need special review.
The package deps include
@cfallin/weval
; if it's preferable, I should probably move the repo to BA and get the appropriate permissions to publish it as@bytecodealliance/weval
.