This directory contains a benchmark comparing WebCC against Emscripten for a Canvas 2D rendering task.
The benchmark renders 10,000 rectangles per frame for 500 frames and measures:
- FPS: Average frames per second.
- Binary Size: Size of the generated
.wasmand.jsfiles. - Memory Usage: JS Heap and WASM Heap usage.
- Python 3: For the runner script.
- Emscripten (
emcc): Required to build the Emscripten benchmark. - WebCC: The project itself.
To build both projects and run the benchmark:
./run.shThis script will:
- Build the WebCC benchmark (
webcc/). - Build the Emscripten benchmark (
emscripten/). - Run
runner.py, which starts a local server and opens both benchmarks in your default browser. - Collect results and generate a report.
If you have already built the projects and just want to run the benchmark:
python3 runner.py --no-buildThe runner generates two files:
benchmark_results.json: Raw data including file sizes and runtime metrics.benchmark_results.svg: A visual comparison chart.
webcc/: Source code for the WebCC implementation.emscripten/: Source code for the Emscripten implementation.runner.py: Python script that orchestrates the benchmark, collects data, and generates reports.run.sh: Bash script to build everything.