Runnable benchmark · controlled · sum-u32
Modulo-2³² Integer Sum
One O(n) scalar loop over an immutable Uint32Array. Addition wraps modulo 2³². The benchmark loop times both engines side-by-side; the oracle is the exact frozen sum.
One run, every engine. Click Start once and the page runs the JavaScript and WebAssembly engines, then the full multi-language comparison (JS / WAT / AssemblyScript / C / C++ / Rust / Dart-WasmGC) — all from the same run control.
Run Benchmark Loop
Ready. Select target and loop iterations, then click Start.
What it does
Sums 1,000,000 integers with 32-bit overflow wrapping.
Why compare Wasm vs JS
Basic 32-bit integer arithmetic loop performance.
Workload identity
- Entry ID
sum-u32- Slug
sum-u32- Tier / class
- T2 · kernel
- Variants
js-controlled·wasm-linear-controlled- Floating-point policy
- none — exact integer arithmetic
- Status
- controlled
Fixed dimensions
- input length
- 65536
- generation
- xorshift32 seed 0x6d2b79f5
- boundary
- wrap modulo 2³²
- oracle sum
- 145417951
Source & build provenance
- Workload contract
- Wasm artifact · build manifest
- Workload sources
- Multi-language kernel sources —
sum_u32.ts·sum.wat·sum_u32.c·sum_u32.cpp·sum_u32.rs·fft_kernel.dart(exports sum_u32)
Multi-Language Comparison
The same modulo-2³² sum kernel written in JavaScript, hand-written WAT, AssemblyScript,
C, C++, Rust, and Dart (WasmGC), compared side by side. All variants are verified
bit-identical to the frozen oracle (sum 145417951). The Dart kernel lives in
fft_kernel.dart and exports sum_u32 on the shared WasmGC
module. Sources:
sum_u32.ts · sum.wat · sum_u32.c · sum_u32.cpp · sum_u32.rs · fft_kernel.dart.
Ready. Select loop iterations, then click Start.