Repository navigation
Profile-Guided Optimization (PGO) bench results for QuickJS #1915
Replies: 3 comments 13 replies
|
https://github.com/quickjs-ng/web-tooling-benchmark is the go-to benchmark suite, it's reasonably representative1 of what people use quickjs for. 1 Insofar any set of benchmarks can be representative. More representative than e.g. Octane or Kraken, at least. |
|
Without PGO. Testing AOT TypeScript and JavaScript compilers, JavaScript (JIT and bytecode interpreter) engines and runtimes that target native executable and WASM ( I also did the same code using dquickts/qjsc --help
QuickJS Compiler version 2026-06-04
usage: qjsc [options] [files]
options are:
# ...
-fno-[date|eval|string-normalize|regexp|json|proxy|map|typedarray|promise|module-loader|weakref|domexception|atob|performance]
disable selected language features (smaller code size)
Bun's |
|
FYI the commands WASI_SDK_PATH=$HOME/bin/wasi-sdk perry compile --function-source=header --opt-report=text --target wasm32-wasip1 -o $HOME/bin/aot/perry/nm_perry_wasip1.wasm ./nm_bun_sync_stream.ts
WASI_SDK_PATH=$HOME/bin/wasi-sdk perry compile --function-source=header --opt-report=text --target wasm32-wasip2 -o $HOME/bin/aot/perry/nm_perry_wasip2.wasm ./nm_bun_sync_stream.ts
perry compile --function-source=header --opt-report=text -o $HOME/bin/aot/perry/nm_perry ./nm_bun_sync_stream.ts
scriptc build nm_bun_sync_stream.ts --optimization=speed --strip -o $HOME/bin/aot/scriptc/nm_scriptc
SCRIPTC_NO_CACHE=1 SCRIPTC_TARGET=wasm32-wasi scriptc build ./nm_bun_sync_stream.ts --optimization=speed -o $HOME/bin/aot/nm_scriptc_wasip1.wasm
/home/user/bin/aot/nm_scriptc_wasip1.wasm
bun build ./nm_bun_sync_stream.ts --target=node --format=esm --no-bundle --outfile=nm_bun_sync_stream.js
node cli.js nm_bun_sync_stream.js -o $HOME/bin/aot/jz/nm_jz.wasm --why --host wasi
WABT_DIR=$HOME/bin/wabt node scripts/native/compile.mjs $HOME/bin/aot/jz/nm_jz.wasm -o $HOME/bin/aot/jz/nm_jz
node ~/localscripts/native-messaging-js2wasm/node_modules/.bin/js2wasm ./nm_bun_sync_stream.ts --target=wasi --no-host-imports --emulate=none -o $HOME/bin/aot/js2wasm
bash ./wasm2elf.sh $HOME/bin/aot/js2wasm/nm_js2wasm.wasm -o $HOME/bin/aot/js2wasm/nm_js2wasm
tslang --emit=exe $HOME/bin/aot/tslang/nm_tslang.ts --opt --opt_level=3 -o $HOME/bin/aot/tslang/nm_tslang
bash $HOME/bin/aot/tslang/tslang2wasi.sh $HOME/bin/aot/tslang/nm_tslang.ts -o $HOME/bin/aot/tslang/nm_tslang.wasm
qjs -c $HOME/bin/aot/quickjs-ng/nm_qjs_opt.js -o $HOME/bin/aot/quickjs-ng/nm_qjs_ng
bash $HOME/bin/aot/quickjs-ng/build.sh nm_qjs_ng
BUN_INSTALL_DIR=$HOME/bin/aot/bun/.bun-cache BUN_OPTIONS="--useJIT=false" bun compile \
--minify --compile --aot \
--no-compile-function-source --trim \
--trim-locales=en --explain=allocations \
--no-compile-autoload-dotenv --no-compile-autoload-bunfig \
--outfile=$HOME/bin/aot/bun/nm_bun $HOME/bin/aot/bun/nm_bun_sync_stream.ts
DENO_CACHE_DIR=$HOME/bin/aot/deno/.deno-cache \
deno compile -A --bundle --minify --engine=quickjs --node-modules-dir \
--exclude-unused-npm --no-npm --no-remote --no-config --no-lock \
-o $HOME/bin/aot/deno/nm_deno_quickjs $HOME/bin/aot/deno/nm_bun_sync_stream.ts
DENO_CACHE_DIR=$HOME/bin/aot/deno/.deno-cache \
deno compile -A --bundle --minify --engine=v8 --node-modules-dir \
--exclude-unused-npm --no-npm --no-remote --no-config --no-lock \
-o $HOME/bin/aot/deno/nm_deno_v8 $HOME/bin/aot/deno/nm_bun_sync_stream.ts
bun build $HOME/bin/aot/node/nm_bun_sync_stream.ts --target=node --format=cjs \
--metafile=$HOME/bin/aot/node/meta.json --metafile-md=$HOME/bin/aot/node/meta.md \
--outfile=$HOME/bin/aot/node/nm_node.cjs
echo '{ "main": "nm_node.cjs", "output": "/home/user/bin/aot/node/nm_node" }'
node --build-sea sea-config.json |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi!
Does anyone have any kind of QuickJS benchmarks with and without PGO for any kind of workload? I mean optimizing the QuickJS itself with PGO to gain more performance (since the project cares about it). I am interested in this kind of information (personal experience, some bench results, etc.) about PGO for QuickJS since I already applied PGO for a dozen of other open-source projects (including some interpreters) with nice performance wins.
If no results are available, I think I can perform the benches on my own if anyone can suggest the best way to bench QuickJS (I'm kinda new in the project). If we get any kind of significant-enough performance win - we can document it somewhere, so will be less chance that people/agents/whatever else will miss this performance-related info.
Thank you.
P.S. I've also checked the original QuickJS repo and also didn't find there info about PGO effects on QuickJS. If you think it will be a good idea to ask the same question in the "upstream" - I can do it too, just didn't want to extra spam.
All reactions