Z vs Go vs Rust

How fast Z, a statically typed language with an LLVM native backend, runs the same programs as Go and Rust. Each workload is written as an honest equivalent in every language, validated against identical output, and run interleaved on the same host.

Relative to Go

Release build time

Wall-clock time to produce an optimized executable (Z: z build --release; Go: go build with a warm standard-library cache; Rust: rustc -C opt-level=3, Cargo release defaults). Log scale. The overflow-checked Rust build (-C overflow-checks=on) takes about as long as the default one; its build times are in the table below.

Source code

The exact programs that were timed. All print the same validated output; Go and Rust versions follow the Z algorithm statement for statement. Tap a workload name in the charts or table to open it here.

Beside Z

All measurements

Medians. Times in milliseconds, memory is peak resident set size. Green marks where Z beats the language selected under “Compare with”.