- Install
RustandDeno(optional) beforehand. - See
Make.zshfor example usages. The following is summary:
-
Checkout:
git clone https://github.com/google/webbundle.git` -
Generate the modules and the benchmarks.
Example:
cd webbundle/webbundle-bench cargo run --release -- --out out --depth 4 --branches 4See
build()inMake.zsh. -
Start webserver.
Example:
cd ../webbundle-server cargo build --release cd ../webbundle-bench RUST_LOG=error ../target/release/webbundle-server --port 8080
See
run_webserver()inMake.zsh. -
Open
http://localhost:8080/out/index.htmlin your browser, and click each benchmark. -
(Optional) Run the benchmark using puppeteer for automation:
deno run --allow-all ./run-bench.ts --port 8080
See
bench()inMake.zsh.
webbundle-bench is inspired by
js-modules-benchmark.
webbundle-bench is rewritten with Rust and Deno so we don't depend on Python and Node.js, and supports very minimum features which are necessary to benchmark Web Bundle loading performance.
webbundle-bench is missing many features at this point:
- Support
modulepreload. - Rules to generate modules.
- Specify the size of generated modules.
- Support other bundlers (e.g.
rollup)