Julia VS Rust benchmarks

Current benchmark data was generated on Fri Sep 30 2022, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][2 cores] Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz (Model 85)

* -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
rust 1.rs 1.8ms 0.4ms 0.6MB 0ms 0ms rustc 1.66.0-nightly
rust 1.rs 2.0ms 0.8ms 0.6MB 0ms 0ms rustc 1.64.0
julia 1.jl 234ms 1.7ms 188.2MB 140ms 108ms julia 1.8.1
julia 1.jl 235ms 57ms 175.4MB 120ms 104ms julia/aot 1.8.2

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 4-i.rs 207ms 1.2ms 0.6MB 197ms 0ms rustc 1.64.0
rust 7-i.rs 287ms 0.9ms 0.6MB 277ms 0ms rustc 1.64.0
rust 3.rs 342ms 0.5ms 0.7MB 330ms 0ms rustc 1.66.0-nightly
rust 2.rs 359ms 3.4ms 0.6MB 347ms 0ms rustc 1.64.0
rust 1.rs 415ms 5.8ms 0.6MB 407ms 0ms rustc 1.64.0
julia 7.jl 547ms 2.9ms 175.1MB 497ms 133ms julia/aot 1.8.2
julia 7.jl 728ms 1.2ms 246.3MB 660ms 157ms julia 1.8.1

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 4-i.rs 24ms 1.2ms 0.6MB 13ms 0ms rustc 1.64.0
rust 7-i.rs 31ms 0.3ms 0.6MB 20ms 0ms rustc 1.64.0
rust 3.rs 37ms 0.5ms 0.7MB 30ms 0ms rustc 1.66.0-nightly
rust 2.rs 38ms 0.1ms 0.6MB 30ms 0ms rustc 1.64.0
rust 1.rs 45ms 0.9ms 0.6MB 33ms 0ms rustc 1.64.0
julia 7.jl 308ms 70ms 179.3MB 203ms 143ms julia/aot 1.8.2
julia 7.jl 448ms 5.0ms 247.9MB 347ms 180ms julia 1.8.1

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 1.jl 434ms 3.0ms 169.0MB 393ms 127ms julia/aot 1.8.2
rust 2.rs 461ms 0.5ms 6.7MB 447ms 0ms rustc 1.64.0
julia 1.jl 572ms 4.4ms 218.1MB 503ms 150ms julia 1.8.1
rust 1.rs 1352ms 162ms 40.9MB 1327ms 7ms rustc 1.64.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 2.rs 105ms 0.7ms 3.1MB 90ms 0ms rustc 1.64.0
rust 1.rs 123ms 2.3ms 11.6MB 107ms 0ms rustc 1.64.0
julia 1.jl 238ms 1.5ms 162.3MB 177ms 103ms julia/aot 1.8.2
julia 1.jl 371ms 2.2ms 211.9MB 293ms 160ms julia 1.8.1

binarytrees

Input: 18

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 4.jl 1267ms 4.9ms 258.1MB 1150ms 207ms julia 1.8.1
rust 4.rs 1768ms 38ms 33.7MB 1743ms 10ms rustc 1.64.0
rust 5.rs 1899ms 6.4ms 33.8MB 1880ms 3ms rustc 1.64.0
rust 3.rs 2017ms 65ms 49.9MB 1977ms 20ms rustc 1.64.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 4.rs 157ms 0.7ms 5.6MB 143ms 0ms rustc 1.64.0
rust 3.rs 167ms 4.4ms 7.8MB 153ms 0ms rustc 1.64.0
rust 5.rs 168ms 0.6ms 6.0MB 157ms 0ms rustc 1.64.0
julia 4.jl 364ms 1.2ms 239.6MB 287ms 160ms julia 1.8.1

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 3-im.rs 649ms 0.6ms 0.7MB 1253ms 0ms rustc 1.64.0
rust 2-im.rs 987ms 13ms 0.7MB 1893ms 0ms rustc 1.64.0
rust 3-i.rs 1213ms 9.5ms 0.6MB 1203ms 0ms rustc 1.64.0
rust 5-m.rs 1217ms 22ms 0.7MB 2327ms 0ms rustc 1.64.0
julia 2-m.jl 1698ms 9.9ms 232.2MB 2857ms 173ms julia 1.8.1
rust 2-i.rs 1797ms 0.7ms 0.6MB 1787ms 0ms rustc 1.64.0
rust 1-m.rs 2029ms 11ms 0.7MB 3927ms 0ms rustc 1.64.0
rust 1.rs 3997ms 10ms 0.6MB 3983ms 0ms rustc 1.64.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 3-im.rs 62ms 0.9ms 0.7MB 97ms 0ms rustc 1.64.0
rust 2-im.rs 90ms 2.2ms 0.7MB 150ms 0ms rustc 1.64.0
rust 3-i.rs 103ms 0.5ms 0.6MB 90ms 0ms rustc 1.64.0
rust 5-m.rs 112ms 0.5ms 0.7MB 190ms 0ms rustc 1.64.0
rust 2-i.rs 153ms 0.6ms 0.6MB 140ms 0ms rustc 1.64.0
rust 1-m.rs 182ms 1.3ms 0.7MB 320ms 0ms rustc 1.64.0
rust 1.rs 337ms 1.1ms 0.6MB 327ms 0ms rustc 1.64.0
julia 2.jl 588ms 2.1ms 230.6MB 707ms 157ms julia 1.8.1

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 5-m.rs 183ms 3.3ms 1.2MB 327ms 0ms rustc 1.64.0
rust 5c-m.rs 183ms 2.1ms 1.2MB 317ms 0ms rustc 1.66.0-nightly
rust 1c.rs 220ms 0.2ms 0.7MB 210ms 0ms rustc 1.66.0-nightly
rust 1.rs 262ms 1.2ms 0.6MB 250ms 0ms rustc 1.64.0
julia 7-m.jl 665ms 11ms 297.6MB 873ms 180ms julia 1.8.1

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1c.rs 25ms 1.9ms 0.6MB 17ms 0ms rustc 1.66.0-nightly
rust 5c-m.rs 27ms 3.2ms 1.3MB 33ms 0ms rustc 1.66.0-nightly
rust 5-m.rs 29ms 1.9ms 1.3MB 33ms 0ms rustc 1.64.0
rust 1.rs 30ms 1.8ms 0.6MB 20ms 0ms rustc 1.64.0
julia 7.jl 506ms 6.2ms 228.8MB 583ms 173ms julia 1.8.1

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 8-m.rs 353ms 13ms 28.7MB 630ms 13ms rustc 1.64.0
rust 8.rs 636ms 5.3ms 24.0MB 610ms 10ms rustc 1.64.0
julia 8.jl 1235ms 3.4ms 317.7MB 1547ms 190ms julia 1.8.1

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 8-m.rs 52ms 4.6ms 16.1MB 63ms 10ms rustc 1.64.0
rust 8.rs 81ms 2.7ms 11.5MB 67ms 0ms rustc 1.64.0
julia 8.jl 869ms 4.0ms 303.0MB 910ms 197ms julia 1.8.1

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 3.jl 733ms 1.1ms 195.4MB 667ms 150ms julia 1.8.1
julia 1.jl 1660ms 14ms 278.2MB 1540ms 203ms julia 1.8.1
rust 1.rs 1738ms 3.3ms 2.8MB 1573ms 150ms rustc 1.64.0
rust 2.rs 1805ms 1.0ms 2.7MB 1737ms 43ms rustc 1.64.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1.rs 374ms 0.9ms 2.4MB 357ms 3ms rustc 1.64.0
julia 3.jl 377ms 22ms 193.9MB 303ms 147ms julia 1.8.1
rust 2.rs 409ms 0.3ms 2.6MB 397ms 0ms rustc 1.64.0
julia 1.jl 963ms 55ms 276.0MB 827ms 200ms julia 1.8.1

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 8-m.rs 889ms 1.1ms 2.6MB 1713ms 0ms rustc 1.66.0-nightly
rust 7-m.rs 892ms 0.5ms 2.2MB 1720ms 0ms rustc 1.64.0
julia 2-m.jl 1239ms 8.9ms 204.1MB 2073ms 147ms julia 1.8.1
rust 8.rs 1718ms 0.1ms 2.5MB 1703ms 0ms rustc 1.66.0-nightly
rust 7.rs 1719ms 0.9ms 2.2MB 1707ms 0ms rustc 1.64.0
rust 2-m.rs 1831ms 13ms 4.0MB 3530ms 3ms rustc 1.64.0
julia 3-m.jl 2089ms 3.2ms 221.8MB 3677ms 177ms julia 1.8.1
rust 2.rs timeout 0.0ms 0.0MB 0ms 0ms rustc 1.64.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 8-m.rs 233ms 1.4ms 2.3MB 427ms 0ms rustc 1.66.0-nightly
rust 7-m.rs 233ms 0.5ms 0.7MB 427ms 0ms rustc 1.64.0
rust 8.rs 432ms 0.3ms 2.2MB 420ms 0ms rustc 1.66.0-nightly
rust 7.rs 435ms 1.6ms 0.6MB 423ms 0ms rustc 1.64.0
rust 2-m.rs 465ms 0.7ms 2.3MB 877ms 0ms rustc 1.64.0
julia 2-m.jl 573ms 4.4ms 203.2MB 787ms 130ms julia 1.8.1
julia 3-m.jl 850ms 8.0ms 221.4MB 1227ms 177ms julia 1.8.1
rust 2.rs 1551ms 0.4ms 0.6MB 1540ms 0ms rustc 1.64.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 8-m.rs 64ms 0.7ms 2.2MB 107ms 0ms rustc 1.66.0-nightly
rust 7-m.rs 66ms 2.4ms 0.7MB 110ms 0ms rustc 1.64.0
rust 8.rs 111ms 0.9ms 2.2MB 100ms 0ms rustc 1.66.0-nightly
rust 7.rs 111ms 1.0ms 0.6MB 100ms 0ms rustc 1.64.0
rust 2-m.rs 125ms 1.5ms 0.7MB 217ms 0ms rustc 1.64.0
rust 2.rs 391ms 1.3ms 0.6MB 380ms 0ms rustc 1.64.0
julia 2.jl 410ms 3.0ms 205.6MB 457ms 143ms julia 1.8.1
julia 3.jl 519ms 3.7ms 220.5MB 617ms 147ms julia 1.8.1