Julia VS Zig benchmarks

Current benchmark data was generated on Wed Sep 28 2022, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][2 cores] Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz (Model 106)

* -m in a file name stands for multi-threading or multi-processing

* -i in a file name stands for direct intrinsics usage. (Usage of simd intrinsics via libraries is not counted)

* -ffi in a file name stands for non-stdlib FFI usage

* (You may find time < time(user) + time(sys) for some non-parallelized programs, the overhead is from GC or JIT compiler, which are allowed to take advantage of multi-cores as that's more close to real-world scenarios.)

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
zig 1.zig 1.4ms 0.1ms 0.6MB 0ms 0ms zig 0.10.0-dev.4192+c75e8f361
julia 1.jl 199ms 0.7ms 188.1MB 128ms 90ms julia 1.8.1
julia 1.jl 207ms 56ms 177.9MB 112ms 88ms julia/aot 1.8.1

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
zig 2.zig 315ms 23ms 0.7MB 303ms 0ms zig 0.10.0-dev.4192+c75e8f361
zig 1.zig 364ms 1.4ms 0.7MB 350ms 0ms zig 0.10.0-dev.4192+c75e8f361
julia 7.jl 551ms 1.8ms 179.8MB 517ms 110ms julia/aot 1.8.1
julia 7.jl 720ms 4.8ms 246.5MB 657ms 143ms julia 1.8.1

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
zig 2.zig 35ms 3.1ms 0.7MB 20ms 0ms zig 0.10.0-dev.4192+c75e8f361
zig 1.zig 40ms 1.7ms 0.7MB 30ms 0ms zig 0.10.0-dev.4192+c75e8f361
julia 7.jl 288ms 72ms 183.2MB 200ms 130ms julia/aot 1.8.1
julia 7.jl 403ms 2.0ms 245.9MB 367ms 113ms julia 1.8.1

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
zig 2.zig 426ms 6.6ms 6.1MB 413ms 0ms zig 0.10.0-dev.4192+c75e8f361
julia 1.jl 428ms 3.5ms 173.7MB 397ms 110ms julia/aot 1.8.1
julia 1.jl 538ms 4.2ms 217.0MB 480ms 140ms julia 1.8.1

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
zig 2.zig 95ms 0.4ms 2.5MB 83ms 0ms zig 0.10.0-dev.4192+c75e8f361
julia 1.jl 234ms 23ms 168.0MB 173ms 93ms julia/aot 1.8.1
julia 1.jl 338ms 1.2ms 213.8MB 290ms 127ms julia 1.8.1

binarytrees

Input: 18

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 4.jl 1110ms 6.4ms 259.7MB 1027ms 157ms julia 1.8.1
zig 1.zig 2187ms 28ms 49.2MB 2163ms 10ms zig 0.10.0-dev.4192+c75e8f361

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
zig 1.zig 175ms 1.6ms 7.1MB 160ms 0ms zig 0.10.0-dev.4192+c75e8f361
julia 4.jl 311ms 2.5ms 240.3MB 267ms 120ms julia 1.8.1

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
zig 2-m.zig 1322ms 13ms 0.7MB 2567ms 0ms zig 0.10.0-dev.4192+c75e8f361
zig 3-i.zig 1564ms 3.3ms 0.6MB 1550ms 0ms zig 0.10.0-dev.4192+c75e8f361
julia 2-m.jl 1825ms 3.7ms 230.6MB 3190ms 123ms julia 1.8.1
zig 2.zig 2504ms 1.6ms 0.6MB 2490ms 0ms zig 0.10.0-dev.4192+c75e8f361
zig 1.zig 3429ms 4.8ms 0.6MB 3413ms 0ms zig 0.10.0-dev.4192+c75e8f361

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
zig 2-m.zig 124ms 1.5ms 2.6MB 217ms 0ms zig 0.10.0-dev.4192+c75e8f361
zig 3-i.zig 132ms 0.5ms 0.6MB 120ms 0ms zig 0.10.0-dev.4192+c75e8f361
zig 2.zig 213ms 0.2ms 0.6MB 200ms 0ms zig 0.10.0-dev.4192+c75e8f361
zig 1.zig 285ms 1.2ms 0.6MB 273ms 0ms zig 0.10.0-dev.4192+c75e8f361
julia 2-m.jl 557ms 2.8ms 233.3MB 697ms 143ms julia 1.8.1

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
zig 1.zig 155ms 0.3ms 0.6MB 147ms 0ms zig 0.10.0-dev.4192+c75e8f361
julia 7-m.jl 640ms 2.1ms 304.3MB 907ms 120ms julia 1.8.1

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
zig 1.zig 18ms 0.5ms 0.6MB 10ms 0ms zig 0.10.0-dev.4192+c75e8f361
julia 7.jl 461ms 0.7ms 230.2MB 540ms 133ms julia 1.8.1

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 8.jl 1163ms 2.5ms 300.7MB 1513ms 140ms julia 1.8.1
zig 1.zig 1234ms 8.1ms 22.0MB 1207ms 13ms zig 0.10.0-dev.4192+c75e8f361

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
zig 1.zig 138ms 1.0ms 9.2MB 123ms 0ms zig 0.10.0-dev.4192+c75e8f361
julia 8.jl 825ms 2.6ms 277.1MB 923ms 133ms julia 1.8.1

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 3.jl 795ms 8.2ms 195.1MB 767ms 110ms julia 1.8.1
julia 1.jl 1405ms 6.8ms 276.8MB 1337ms 147ms julia 1.8.1
zig 1.zig 2200ms 1.9ms 2.4MB 2173ms 10ms zig 0.10.0-dev.4192+c75e8f361

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 3.jl 350ms 2.3ms 192.7MB 313ms 117ms julia 1.8.1
zig 1.zig 494ms 0.2ms 2.0MB 483ms 0ms zig 0.10.0-dev.4192+c75e8f361
julia 1.jl 808ms 27ms 277.9MB 727ms 140ms julia 1.8.1

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
zig 2-m.zig 1067ms 4.3ms 1.8MB 2063ms 0ms zig 0.10.0-dev.4192+c75e8f361
julia 2-m.jl 1370ms 1.4ms 204.6MB 2403ms 117ms julia 1.8.1
zig 2.zig 2065ms 1.0ms 1.6MB 2050ms 0ms zig 0.10.0-dev.4192+c75e8f361
julia 3-m.jl 2078ms 13ms 220.1MB 3710ms 127ms julia 1.8.1
zig 1.zig 4582ms 5.2ms 1.6MB 4567ms 0ms zig 0.10.0-dev.4192+c75e8f361

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
zig 2-m.zig 277ms 1.4ms 0.8MB 510ms 0ms zig 0.10.0-dev.4192+c75e8f361
zig 2.zig 518ms 1.1ms 0.7MB 510ms 0ms zig 0.10.0-dev.4192+c75e8f361
julia 2-m.jl 588ms 3.1ms 206.9MB 873ms 107ms julia 1.8.1
julia 3-m.jl 797ms 1.9ms 221.3MB 1217ms 127ms julia 1.8.1
zig 1.zig 1147ms 0.2ms 0.6MB 1137ms 0ms zig 0.10.0-dev.4192+c75e8f361

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
zig 2-m.zig 76ms 2.3ms 0.8MB 120ms 0ms zig 0.10.0-dev.4192+c75e8f361
zig 2.zig 132ms 0.1ms 0.7MB 120ms 0ms zig 0.10.0-dev.4192+c75e8f361
zig 1.zig 289ms 0.5ms 0.7MB 280ms 0ms zig 0.10.0-dev.4192+c75e8f361
julia 2-m.jl 386ms 1.0ms 206.4MB 463ms 123ms julia 1.8.1
julia 3.jl 478ms 3.5ms 221.4MB 593ms 120ms julia 1.8.1