All Rust benchmarks

Current benchmark data was generated on Fri Dec 09 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.)

fasta

Input: 2500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
5c-m.rs 185ms 2.6ms 1.7MB 327ms 3ms rustc 1.67.0-nightly
5-m.rs 189ms 2.6ms 1.7MB 337ms 0ms rustc 1.65.0
1c.rs 215ms 1.0ms 1.0MB 203ms 0ms rustc 1.67.0-nightly
1.rs 264ms 1.5ms 1.0MB 253ms 0ms rustc 1.65.0

Input: 250000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1c.rs 24ms 0.1ms 1.0MB 13ms 0ms rustc 1.67.0-nightly
5c-m.rs 26ms 0.9ms 1.7MB 33ms 0ms rustc 1.67.0-nightly
5-m.rs 27ms 0.8ms 1.7MB 30ms 3ms rustc 1.65.0
1.rs 29ms 0.7ms 1.0MB 20ms 0ms rustc 1.65.0

helloworld

Input: QwQ

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rs 1.6ms 0.8ms 1.0MB 0ms 0ms rustc 1.67.0-nightly
1.rs 1.8ms 0.6ms 1.8MB 0ms 0ms rustc 1.65.0

mandelbrot

Input: 5000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
9.rs 358ms 0.2ms 4.8MB 350ms 0ms rustc 1.67.0-nightly
8.rs 428ms 1.7ms 4.9MB 417ms 0ms rustc 1.65.0

Input: 1000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
9.rs 17ms 0.1ms 1.0MB 10ms 0ms rustc 1.67.0-nightly
8.rs 20ms 0.3ms 1.0MB 10ms 0ms rustc 1.65.0

nbody

Input: 5000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4-i.rs 212ms 0.3ms 1.1MB 200ms 0ms rustc 1.65.0
7-i.rs 309ms 0.3ms 1.1MB 297ms 0ms rustc 1.65.0
3.rs 338ms 4.8ms 1.1MB 323ms 0ms rustc 1.67.0-nightly
2.rs 345ms 2.8ms 1.0MB 333ms 0ms rustc 1.65.0
1.rs 406ms 7.9ms 1.0MB 393ms 0ms rustc 1.65.0

Input: 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4-i.rs 24ms 1.1ms 1.1MB 13ms 0ms rustc 1.65.0
7-i.rs 33ms 0.4ms 1.0MB 27ms 0ms rustc 1.65.0
3.rs 36ms 0.1ms 1.1MB 30ms 0ms rustc 1.67.0-nightly
2.rs 38ms 1.1ms 1.1MB 27ms 0ms rustc 1.65.0
1.rs 44ms 1.3ms 1.0MB 33ms 0ms rustc 1.65.0

spectral-norm

Input: 8000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
8-m.rs 889ms 1.9ms 2.5MB 1717ms 0ms rustc 1.67.0-nightly
7-m.rs 892ms 0.8ms 2.3MB 1727ms 0ms rustc 1.65.0
8.rs 1722ms 0.3ms 2.4MB 1710ms 0ms rustc 1.67.0-nightly
7.rs 1729ms 1.1ms 2.1MB 1720ms 0ms rustc 1.65.0
2-m.rs 1813ms 4.5ms 2.1MB 3543ms 0ms rustc 1.65.0
2.rs timeout 0.0ms 0.0MB 0ms 0ms rustc 1.65.0

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
7-m.rs 232ms 0.9ms 1.0MB 423ms 0ms rustc 1.65.0
8-m.rs 232ms 2.6ms 2.1MB 427ms 0ms rustc 1.67.0-nightly
8.rs 433ms 0.4ms 2.2MB 420ms 0ms rustc 1.67.0-nightly
7.rs 435ms 0.4ms 1.0MB 423ms 0ms rustc 1.65.0
2-m.rs 469ms 6.3ms 2.1MB 890ms 0ms rustc 1.65.0
2.rs 1627ms 1.1ms 1.0MB 1617ms 0ms rustc 1.65.0

Input: 2000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
7-m.rs 63ms 0.3ms 1.1MB 103ms 0ms rustc 1.65.0
8-m.rs 63ms 0.6ms 1.0MB 103ms 0ms rustc 1.67.0-nightly
8.rs 111ms 0.3ms 1.0MB 100ms 0ms rustc 1.67.0-nightly
7.rs 112ms 1.3ms 1.0MB 100ms 0ms rustc 1.65.0
2-m.rs 122ms 0.6ms 1.1MB 220ms 0ms rustc 1.65.0
2.rs 409ms 0.5ms 1.0MB 400ms 0ms rustc 1.65.0

binarytrees

Input: 18

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4.rs 1678ms 9.0ms 33.7MB 1660ms 3ms rustc 1.65.0
5.rs 1830ms 14ms 33.8MB 1807ms 7ms rustc 1.65.0
3.rs 1926ms 12ms 49.8MB 1897ms 10ms rustc 1.65.0

Input: 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4.rs 152ms 0.9ms 5.7MB 140ms 0ms rustc 1.65.0
5.rs 164ms 1.6ms 5.8MB 150ms 0ms rustc 1.65.0
3.rs 170ms 3.1ms 7.7MB 153ms 0ms rustc 1.65.0

coro-prime-sieve

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3-m.rs 973ms 63ms 6.2MB 1843ms 37ms rustc 1.65.0
5-m.rs 1121ms 91ms 5.2MB 2153ms 27ms rustc 1.65.0
3.rs 1806ms 10ms 6.2MB 1760ms 30ms rustc 1.65.0
4.rs 2994ms 7.6ms 4.3MB 2983ms 0ms rustc 1.65.0
1-m.rs 3147ms 43ms 4.9MB 6093ms 80ms rustc 1.65.0

Input: 1000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3-m.rs 92ms 16ms 2.8MB 150ms 3ms rustc 1.65.0
5-m.rs 107ms 26ms 2.9MB 177ms 10ms rustc 1.65.0
3.rs 115ms 2.7ms 3.1MB 103ms 0ms rustc 1.65.0
4.rs 195ms 0.3ms 2.3MB 183ms 0ms rustc 1.65.0
1-m.rs 216ms 2.6ms 2.9MB 390ms 10ms rustc 1.65.0

edigits

Input: 250001

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rs 138ms 0.3ms 3.5MB 130ms 0ms rustc 1.65.0
2.rs 573ms 0.6ms 3.7MB 560ms 0ms rustc 1.65.0

Input: 100000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rs 38ms 1.0ms 2.8MB 30ms 0ms rustc 1.65.0
2.rs 111ms 0.7ms 3.1MB 100ms 0ms rustc 1.65.0

fannkuch-redux

Input: 11

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3-im.rs 571ms 2.5ms 1.0MB 1100ms 0ms rustc 1.65.0
2-im.rs 959ms 19ms 1.0MB 1837ms 0ms rustc 1.65.0
5-m.rs 1190ms 4.2ms 1.1MB 2267ms 0ms rustc 1.65.0
3-i.rs 1197ms 29ms 1.1MB 1187ms 0ms rustc 1.65.0
2-i.rs 1805ms 1.0ms 1.0MB 1793ms 0ms rustc 1.65.0
1-m.rs 2352ms 21ms 1.0MB 4533ms 0ms rustc 1.65.0
1.rs 3876ms 21ms 1.0MB 3860ms 0ms rustc 1.65.0

Input: 10

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3-im.rs 53ms 0.2ms 1.1MB 87ms 0ms rustc 1.65.0
2-im.rs 86ms 2.7ms 1.1MB 147ms 0ms rustc 1.65.0
3-i.rs 101ms 1.3ms 1.0MB 90ms 0ms rustc 1.65.0
5-m.rs 102ms 0.8ms 1.1MB 180ms 0ms rustc 1.65.0
2-i.rs 153ms 0.7ms 1.0MB 140ms 0ms rustc 1.65.0
1-m.rs 205ms 1.5ms 1.0MB 370ms 0ms rustc 1.65.0
1.rs 325ms 1.4ms 1.1MB 313ms 0ms rustc 1.65.0

http-server

Input: 3000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rs 186ms 56ms 49.2MB 110ms 113ms rustc 1.65.0
2-http2.rs 306ms 59ms 43.0MB 387ms 107ms rustc 1.65.0
2-m.rs 547ms 8.5ms 109.9MB 300ms 543ms rustc 1.65.0
1-http2.rs 958ms 57ms 82.5MB 1127ms 523ms rustc 1.65.0

Input: 500

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rs 98ms 3.5ms 22.0MB 37ms 27ms rustc 1.65.0
2.rs 138ms 5.7ms 28.4MB 53ms 77ms rustc 1.65.0
2-http2.rs 275ms 12ms 29.9MB 370ms 73ms rustc 1.65.0
1-http2.rs 390ms 3.8ms 29.1MB 550ms 103ms rustc 1.65.0

json-serde

Input: sample 5000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.rs 80ms 1.5ms 38.1MB 57ms 10ms rustc 1.65.0
3.rs 80ms 1.0ms 36.3MB 50ms 17ms rustc 1.65.0
1.rs 136ms 0.1ms 75.4MB 83ms 37ms rustc 1.65.0

Input: canada 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3.rs 509ms 1.8ms 257.5MB 377ms 120ms rustc 1.65.0
2.rs 515ms 1.9ms 258.1MB 400ms 100ms rustc 1.65.0
1.rs 914ms 1.3ms 604.9MB 643ms 250ms rustc 1.65.0

knucleotide

Input: 2500000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
8-m.rs 358ms 5.4ms 27.7MB 647ms 10ms rustc 1.65.0
8.rs 675ms 3.7ms 24.2MB 650ms 10ms rustc 1.65.0

Input: 250000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
8-m.rs 53ms 1.4ms 18.3MB 63ms 7ms rustc 1.65.0
8.rs 79ms 1.7ms 11.6MB 57ms 10ms rustc 1.65.0

lru

Input: 1000 1000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
0-unsafe.rs 52ms 1.8ms 1.0MB 47ms 0ms rustc 1.65.0
1.rs 73ms 0.8ms 1.1MB 60ms 0ms rustc 1.65.0

Input: 1000 3000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
0-unsafe.rs 188ms 15ms 1.0MB 180ms 0ms rustc 1.65.0
1.rs 294ms 0.6ms 1.1MB 283ms 0ms rustc 1.65.0

Input: 100 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
0-unsafe.rs 31ms 0.4ms 1.1MB 20ms 0ms rustc 1.65.0
1.rs 46ms 0.2ms 1.0MB 40ms 0ms rustc 1.65.0

merkletrees

Input: 17

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rs 908ms 2.6ms 33.8MB 883ms 10ms rustc 1.65.0

Input: 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rs 187ms 0.5ms 9.9MB 170ms 0ms rustc 1.65.0

nsieve

Input: 12

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.rs 439ms 1.8ms 6.5MB 427ms 0ms rustc 1.65.0
1.rs 822ms 39ms 40.9MB 797ms 10ms rustc 1.65.0

Input: 10

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.rs 98ms 0.7ms 3.1MB 87ms 0ms rustc 1.65.0
1.rs 129ms 4.5ms 11.5MB 117ms 0ms rustc 1.65.0

pidigits

Input: 8000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.rs 1616ms 0.9ms 2.7MB 1543ms 57ms rustc 1.65.0
1.rs 1694ms 6.5ms 2.7MB 1530ms 147ms rustc 1.65.0

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.rs 365ms 0.1ms 2.5MB 350ms 0ms rustc 1.65.0
1.rs 367ms 1.2ms 2.5MB 343ms 7ms rustc 1.65.0

regex-redux

Input: 2500000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
7.rs 572ms 5.3ms 77.4MB 747ms 20ms rustc 1.65.0

Input: 250000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
7.rs 63ms 0.8ms 11.2MB 70ms 0ms rustc 1.65.0

secp256k1

Input: 2000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
0.rs 138ms 2.5ms 1.1MB 130ms 0ms rustc 1.65.0
1.rs 1876ms 0.7ms 1.0MB 1863ms 0ms rustc 1.65.0

Input: 500

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
0.rs 37ms 0.2ms 1.1MB 30ms 0ms rustc 1.65.0
1.rs 472ms 0.6ms 1.0MB 460ms 0ms rustc 1.65.0