5 releases (3 breaking)

0.5.1 Dec 5, 2022
0.5.0 Dec 2, 2022
0.4.1 Nov 30, 2022
0.2.0 Nov 30, 2022
0.1.0 Jun 8, 2022

#278 in Profiling

Apache-2.0

76KB
1.5K SLoC

Rust 1.5K SLoC // 0.1% comments TypeScript 173 SLoC // 0.1% comments Zsh 37 SLoC // 0.2% comments

Synthetic Module Benchmark with Web Bundles

Basic Usage

  • Install Rust and Deno (optional) beforehand.
  • See Make.zsh for example usages. The following is summary:
  1. Checkout:

    git clone https://github.com/google/webbundle.git`
    
  2. Generate the modules and the benchmarks.

    Example:

    cd webbundle/webbundle-bench
    cargo run --release -- --out out --depth 4 --branches 4
    

    See build() in Make.zsh.

  3. Start webserver.

    Example:

    cd ../webbundle-server
    cargo build --release
    cd ../webbundle-bench
    RUST_LOG=error ../target/release/webbundle-server --port 8080
    

    See run_webserver() in Make.zsh.

  4. Open http://localhost:8080/out/index.html in your browser, and click each benchmark.

  5. (Optional) Run the benchmark using puppeteer for automation:

    deno run --allow-all ./run-bench.ts --port 8080
    

    See bench() in Make.zsh.

What's not implemented

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)

Dependencies

~8–16MB
~222K SLoC