Targets and benchmarks

Compare generated C, Go, native ZX and WebAssembly. Each workload includes measured run times and the output it checks.

.zi Source.zir ZIR.c · .go · .zx · .wasm Four outputs

Compiler outputs

Open any cell to inspect the generated output.

Example programs compiled to four targets
Exampleµs per callCzi2cGozi2goZX nativezi2zxWasmzx2wasm
Records & callsscore.ziVerified0.00116Verified0.00136Verified0.0245Verified0.0464
Text & importstext_demo.ziVerified0.00348Verified0.00477Verified0.0239Verified0.0458
Arrays & slicesarrays.ziVerified0.402Verified3.41Verified0.476Verified0.418
Enums & branchesenums.ziVerified0.143Verified1.98Verified0.171Verified0.228
Loops & collectionsloops.ziVerified0.697Verified8.58Verified0.701Verified0.524

Scroll to compare the results →

Median warm execution per entry after symmetric 1.5×IQR filtering.

Inside the compiler

Records & calls

Expected result: 42
Download .zi ↓

The exact source used for every target in this row.

Score :: struct {
    value: s32;
    bonus: s32;
}

Total :: (score: Score) -> s32 {
    return score.value + score.bonus;
}

Answer :: () -> s32 {
    score: Score = Score.{value = 40, bonus = 2};
    return Total(score);
}

Kryon widgets

Button activation, text layout and UTF-8 input editing through public Kryon APIs. Includes paint-command generation with recorded output; excludes pixel rasterization and OS I/O.

Kryon widgets
WorkloadMedian µs per two-frame scenarioCGoZX nativeWasmRatio to C
ButtonPointer press and release, activation and paint commands2.774.173.952.41ZX 1.43×Wasm 0.872×
TextText measurement, layout and paint commands3.133.735.583.57ZX 1.78×Wasm 1.14×
InputUTF-8 editing, cursor motion and paint commands4.077.416.283.37ZX 1.54×Wasm 0.828×

Warm calls reuse the runner and widget sessions. The Wasm runs use no step budget. Samples and paint checksums · Sources · Checked IR

Compiler kernels

Small programs compare calls, memory and instruction throughput across execution tiers.

Compiler kernel results
WorkloadMedian µs per callCGoZX engineZX nativeWasmRatio to C
SieveMark and count primes in a buffer33.642.51,31037.639ZX 1.12×Wasm 1.16×
RecordsRead record fields and call procedures1613.81,18031.941.8ZX 2×Wasm 2.62×
HashDependent integer hashing26.727.41,22028.327.4ZX 1.06×Wasm 1.02×
VectorsTransform and sum data in vectors34.759.11,50041.250.4ZX 1.19×Wasm 1.45×
PrintingFormat output through the host boundary9.3368.914.99.394.73ZX 1.01×Wasm 0.507×

All calls are warm. The host gate repeats jobs when clock speed or a busy sibling thread would skew the result. Samples and exclusions · Measured compiler revision

Standard scalar benchmarks

Independent C and Go implementations use the same inputs and algorithms as ZX native and Wasm. Every result is checked against C.

Standard workloads

Standard workloads
WorkloadMedian µs per runCGoZX nativeWasmRatio to C
fib · 35Recursive integer calls16,40038,70040,90034,800ZX 2.49×Wasm 2.12×
n-body · 500,000Five-body simulation and energy calculation30,70036,50064,30039,200ZX 2.1×Wasm 1.28×
spectral-norm · 500Repeated implicit matrix-vector products11,20016,90012,40015,700ZX 1.11×Wasm 1.4×
mandelbrot · 1,000Escape-time pixel calculation and bitmap packing71,50075,000144,00078,600ZX 2.01×Wasm 1.1×
fannkuch-redux · 9Permutation generation and prefix reversal16,10015,50016,20018,400ZX 1.01×Wasm 1.15×
binary-trees · 14Recursive allocation, traversal and reclamation93,50084,80039,20086,000ZX 0.419×Wasm 0.92×
fasta · 1,000,000Seeded nucleotide generation and output digest111,000116,000128,000126,000ZX 1.15×Wasm 1.14×
nqueens · 12Bit-set search and recursive backtracking5,6605,6906,8506,380ZX 1.21×Wasm 1.13×
matmul · 192Dense integer matrix multiplication4,0206,97011,9006,970ZX 2.97×Wasm 1.73×
quicksort · 200,000In-place partitioning on generated integers12,70014,00012,70013,800ZX 1×Wasm 1.09×
string-hash · 100,000Byte traversal with a dependent FNV-1a hash5,6005,6205,6205,630ZX 1×Wasm 1.01×
k-nucleotide · 1,000,000Rolling 7-mer counts in a dense histogram2,0502,0403,3402,720ZX 1.63×Wasm 1.33×
reverse-complement · 1,000,000Reverse DNA base mapping into an output buffer5,4505,0006,6906,140ZX 1.23×Wasm 1.13×
pidigits · 1,000Decimal spigot using a mixed-radix bignum35,50035,80049,70050,700ZX 1.4×Wasm 1.43×
json-roundtrip · 16,000Parse and compact JSON objects with integer values3,9404,5006,2606,610ZX 1.59×Wasm 1.68×
lz77 · 262,144Sliding-window match search and literal/token digest9731,0601,3401,220ZX 1.37×Wasm 1.25×
sha256 · 262,144Scalar SHA-256 compression and final padding1,2101,4403,2201,840ZX 2.67×Wasm 1.53×
crc32 · 1,048,576Table-driven IEEE CRC-322,9502,8504,5804,130ZX 1.55×Wasm 1.4×
ray-trace · 192Primary rays, nearest sphere intersections and diffuse shading4,3204,9207,1604,690ZX 1.66×Wasm 1.09×
sudoku · 9Constraint propagation and recursive board search22,90019,90023,20023,400ZX 1.01×Wasm 1.02×
dijkstra · 48Shortest paths on a weighted grid with a dense frontier scan4,1205,1107,0506,110ZX 1.71×Wasm 1.48×
word-count · 200,000Token scanning and open-addressed frequency counts5,5305,3108,2906,210ZX 1.5×Wasm 1.12×
radix-sort · 262,144Four stable counting passes over 32-bit keys8,5207,7908,8808,310ZX 1.04×Wasm 0.976×
lu · 192In-place dense LU factorization without pivot exchanges1,3601,9403,0202,090ZX 2.22×Wasm 1.53×
fft · 14Radix-2 complex FFT with bit reversal and twiddles; input is log₂ length7788521,4501,160ZX 1.86×Wasm 1.49×
bytecode · 12,000Eight-opcode register interpreter over generated instructions5,6604,6708,3305,890ZX 1.47×Wasm 1.04×
heat-grid · 19232 floating-point diffusion passes over two grids1,4102,0902,1702,710ZX 1.53×Wasm 1.91×
particle-update · 16,38464 steps of record updates, forces and boundary handling3,5904,7906,2305,950ZX 1.74×Wasm 1.66×
image-filter · 512Separable image blur, sharpening and byte conversion2,2503,2003,9904,090ZX 1.77×Wasm 1.82×

Raw samples, exclusions and provenance

Compile time

Median µs per complete build of the standard suite
ProgramMedian µs per buildCGoGenerated C + cc -O2ZX nativeWasm
All 29 workloads750,000244,000519,000805,000729,000

One unmeasured warmup, then 11 fresh application builds with rotating target order and symmetric 1.5×IQR filtering. Filesystem and toolchain caches stay warm; Go application source changes to prevent cache hits, and Go runs with GOMAXPROCS=2. Generated C includes compilation and linking; native includes frontend, host compilation, linking and native instantiation. Wasm includes frontend and module emission; V8 compilation is excluded. Artifact validation runs outside timing. Builds are not pinned to one CPU. No fast compiler mode is available. Raw samples, exclusions and provenance.

Checks off; learning off. Every run is pinned to one CPU and repeated until that CPU held a steady clock at its calibrated sustained speed with the other hyperthread of its core idle; Go uses GOMAXPROCS=1 there. At least 150 ms warmup, then 11 in-process samples. Medians exclude symmetric 1.5×IQR outliers. Every result is checked against C; raw samples and excluded indices remain available. Startup and compilation are excluded. Binary trees include allocation and reclamation using each language's allocator or default GC. Mandelbrot and FASTA digest generated bytes, excluding file output; floating results are rounded to nine decimals. Selected Benchmarks Game workloads also have larger performance inputs. Sources: bench/standard.

Measurement method

All four targets reproduce the independently checked return value or printed output of each source. Compare target behavior and costs on these small programs; the figures describe this run and its host.

Execution

Median warm time after 150 ms of warmup and calibrated batches, excluding symmetric 1.5×IQR outliers. Raw samples and exclusions remain downloadable. Loading, startup, downloads and offline compilation are excluded. Output is verified before timing; formatting and runtime-specific output to a null sink or browser callback remain included. Tiny programs emphasize call and I/O overhead.

Emission

Loading, checking, linking and writing the selected output on the desktop build host. C uses cc -O2 and Go uses go build afterward; those downstream build costs are excluded from emission. ZIR is inspected, not executed.

Size & coverage

Size counts emitted files, including C headers and imported modules. The examples run with native ZX and WebAssembly in V8. The inspector still shows the portable ZX bundle and the generated Wasm module.

The snapshot includes the host, compiler hashes, revision, tool versions and every sample.

Run the benchmark yourself
make
build-queue -- python3 scripts/site_target_platforms.py --platform desktop --rebuild-outputs --samples 11
python3 scripts/site_targets.py --check

Example execution uses the host gate. Emission runs with warm filesystem caches. Small examples emphasize call, output and runtime overhead.

Read current support → · The ZIR format → · WebAssembly execution tier →

JSON and UTF-8

Inputs are prepared during warmup. Timed calls parse or serialize, allocate output and validate the result.

JSON and UTF-8
WorkloadMedian µs per operationCGoZX nativeWasmRatio to C
JSON string scan · 16 KiBFind the end of a long JSON string0.89368.941.632.3ZX 46.5×Wasm 36.2×
JSON parse · 16 KiB stringDecode one long JSON string1.2373.949.945ZX 40.5×Wasm 36.5×
JSON parse · 128 escaped Unicode objectsDecode escaped and Unicode values inside objects27.575719390.6ZX 7.02×Wasm 3.3×
JSON write · 256 mixed Unicode stringsSerialize mixed Unicode strings12.950.138.838.6ZX 3×Wasm 2.98×
JSON write · 64 KiB ASCII stringQuote a long ASCII string9.71447277234ZX 28.5×Wasm 24.1×
UTF-8 · scan, search, replace and split · 18 KiBScan, search, replace and split multibyte text16997.8248201ZX 1.47×Wasm 1.19×

Samples, exclusions and verified outputs

Kryon 3D scenes

Animated scenes rendered on the GPU through Kryon's OpenGL ES backend, at two sizes.

Kryon 3D scenes
Sceneµs per frame640×360Mean640×360p951920×1080Mean1920×1080p95
Lit meshesMeshes shaded by scene lights4445542,2902,480
Skinned characterAn articulated character with weighted joint deformation4084262,2702,630
Textured roomA textured room3894592,2602,450
Particle fieldTransparent particles sorted every frame5516152,2702,430

Each scene and size times 60 completed frames after 8 warmup frames and hashes every frame. Scene construction, shader compilation, warmup and hashing are outside the timing; p95 is nearest rank. GPU: NVIDIA GeForce RTX 5060 Ti/PCIe/SSE2 OpenGL ES 3.2 NVIDIA 595.99.02. Frame times and hashes · Raw records · Kryon revision