Julia VS Go benchmarks

Current benchmark data was generated on Sun Jan 29 2023, 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
go 1.go 1.4ms 0.5ms 0.1MB 0ms 0ms tinygo 0.25.0
go 1.go 2.6ms 0.4ms 2.9MB 0ms 0ms go 1.19.5
julia 1.jl 179ms 0.4ms 163.9MB 114ms 70ms julia/aot 1.8.5
julia 1.jl 194ms 1.8ms 171.2MB 132ms 76ms julia 1.8.5

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 456ms 1.4ms 2.9MB 440ms 0ms go 1.19.5
julia 7.jl 549ms 0.1ms 168.6MB 507ms 120ms julia/aot 1.8.5
julia 7.jl 709ms 1.2ms 224.5MB 663ms 120ms julia 1.8.5
go 1.go 843ms 1.0ms 0.0MB 830ms 0ms tinygo 0.25.0

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 51ms 3.8ms 2.9MB 40ms 0ms go 1.19.5
go 1.go 86ms 0.6ms 0.0MB 80ms 0ms tinygo 0.25.0
julia 7.jl 246ms 3.3ms 169.8MB 210ms 100ms julia/aot 1.8.5
julia 7.jl 395ms 6.8ms 223.7MB 333ms 133ms julia 1.8.5

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 1.jl 423ms 0.6ms 156.3MB 390ms 113ms julia/aot 1.8.5
julia 1.jl 528ms 2.4ms 203.3MB 487ms 113ms julia 1.8.5
go 2.go 623ms 4.5ms 17.6MB 613ms 0ms tinygo 0.25.0
go 1.go 669ms 21ms 75.2MB 640ms 13ms go 1.19.5
go 1.go 727ms 17ms 43.1MB 707ms 3ms tinygo 0.25.0
go 2.go 904ms 0.7ms 20.0MB 883ms 7ms go 1.19.5

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 121ms 2.3ms 22.1MB 107ms 3ms go 1.19.5
go 1.go 131ms 0.7ms 13.4MB 120ms 0ms tinygo 0.25.0
go 2.go 146ms 0.4ms 5.6MB 140ms 0ms tinygo 0.25.0
go 2.go 216ms 2.8ms 9.1MB 203ms 3ms go 1.19.5
julia 1.jl 220ms 2.5ms 150.2MB 177ms 87ms julia/aot 1.8.5
julia 1.jl 326ms 1.7ms 195.1MB 293ms 113ms julia 1.8.5

binarytrees

Input: 18

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 4.jl 1112ms 26ms 239.5MB 1023ms 163ms julia 1.8.5
go 1.go 3040ms 4.2ms 45.1MB 4367ms 53ms go 1.19.5
go 1.go 3913ms 11ms 39.6MB 3890ms 7ms tinygo 0.25.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 274ms 7.4ms 8.2MB 337ms 7ms go 1.19.5
julia 4.jl 304ms 1.4ms 221.2MB 263ms 120ms julia 1.8.5
go 1.go 349ms 1.6ms 7.1MB 337ms 0ms tinygo 0.25.0

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 3-m.go 1395ms 1.7ms 5.0MB 2700ms 7ms go 1.19.5
julia 2-m.jl 1775ms 12ms 210.1MB 3120ms 127ms julia 1.8.5
go 3.go 2942ms 4.0ms 49.9MB 2917ms 3ms tinygo 0.25.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 3-m.go 144ms 2.6ms 5.0MB 220ms 0ms go 1.19.5
go 3.go 312ms 0.4ms 48.4MB 297ms 3ms tinygo 0.25.0
julia 2-m.jl 527ms 5.9ms 209.8MB 693ms 117ms julia 1.8.5

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 3-m.go 252ms 2.9ms 4.9MB 460ms 0ms go 1.19.5
julia 7-m.jl 630ms 2.1ms 291.8MB 860ms 147ms julia 1.8.5

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 3.go 33ms 2.2ms 2.9MB 40ms 0ms go 1.19.5
julia 7-m.jl 451ms 0.5ms 226.0MB 563ms 117ms julia 1.8.5

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 8.jl 1118ms 9.1ms 273.3MB 1470ms 157ms julia 1.8.5
go 7-m.go 1498ms 12ms 42.0MB 2803ms 20ms go 1.19.5

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 7-m.go 233ms 8.4ms 24.0MB 363ms 17ms go 1.19.5
julia 8.jl 763ms 4.0ms 259.1MB 847ms 143ms julia 1.8.5

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 3.jl 791ms 4.6ms 176.9MB 760ms 103ms julia 1.8.5
julia 1.jl 1373ms 3.2ms 260.8MB 1303ms 147ms julia 1.8.5
go 8.go 1390ms 1.4ms 8.5MB 1367ms 7ms go 1.19.5

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 8.go 335ms 5.3ms 8.4MB 317ms 0ms go 1.19.5
julia 3.jl 342ms 0.3ms 176.2MB 307ms 113ms julia 1.8.5
julia 1.jl 780ms 23ms 261.5MB 710ms 133ms julia 1.8.5

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 2-m.jl 1370ms 7.3ms 192.9MB 2410ms 103ms julia 1.8.5
julia 3-m.jl 2107ms 0.8ms 211.4MB 3787ms 123ms julia 1.8.5
go 4-m.go 2502ms 32ms 6.9MB 4830ms 3ms go 1.19.5
go 1.go 4961ms 8.6ms 5.5MB 4950ms 0ms go 1.19.5
go 1.go timeout 0.0ms 0.4MB 4987ms 0ms tinygo 0.25.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 2-m.jl 578ms 0.1ms 192.5MB 853ms 110ms julia 1.8.5
go 4-m.go 632ms 4.9ms 2.9MB 1197ms 0ms go 1.19.5
julia 3-m.jl 804ms 1.2ms 210.3MB 1233ms 120ms julia 1.8.5
go 1.go 1248ms 4.9ms 2.9MB 1230ms 0ms go 1.19.5
go 1.go 2584ms 6.9ms 0.0MB 2567ms 0ms tinygo 0.25.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 4-m.go 168ms 1.6ms 4.9MB 293ms 0ms go 1.19.5
go 1.go 316ms 2.0ms 4.9MB 303ms 0ms go 1.19.5
julia 2-m.jl 381ms 2.7ms 192.3MB 467ms 113ms julia 1.8.5
julia 3.jl 477ms 5.1ms 211.5MB 577ms 137ms julia 1.8.5
go 1.go 645ms 0.1ms 0.0MB 633ms 0ms tinygo 0.25.0