All Rust benchmarks

Current benchmark data was generated on Thu May 04 2023, 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 198ms 3.0ms 1.7MB 347ms 0ms rustc 1.71.0-nightly
5-m.rs 209ms 14ms 1.7MB 353ms 10ms rustc 1.69.0
1c.rs 213ms 5.1ms 1.0MB 200ms 0ms rustc 1.71.0-nightly
1.rs 263ms 0.2ms 1.1MB 250ms 0ms rustc 1.69.0

Input: 250000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1c.rs 24ms 1.1ms 1.0MB 13ms 0ms rustc 1.71.0-nightly
1.rs 29ms 0.3ms 1.1MB 20ms 0ms rustc 1.69.0
5c-m.rs 30ms 3.4ms 1.7MB 37ms 0ms rustc 1.71.0-nightly
5-m.rs 36ms 4.2ms 1.7MB 43ms 0ms rustc 1.69.0

helloworld

Input: QwQ

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rs 1.8ms 0.5ms 1.0MB 0ms 0ms rustc 1.69.0
1.rs 1.9ms 0.4ms 1.0MB 0ms 0ms rustc 1.71.0-nightly

mandelbrot

Input: 5000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
9.rs 364ms 0.6ms 4.9MB 353ms 0ms rustc 1.71.0-nightly
8.rs 430ms 2.4ms 4.6MB 417ms 0ms rustc 1.69.0

Input: 1000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
9.rs 20ms 1.7ms 1.0MB 10ms 0ms rustc 1.71.0-nightly
8.rs 21ms 0.8ms 1.0MB 10ms 0ms rustc 1.69.0

nbody

Input: 5000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4-i.rs 213ms 5.0ms 1.0MB 200ms 0ms rustc 1.69.0
3.rs 317ms 7.0ms 1.0MB 307ms 0ms rustc 1.71.0-nightly
7-i.rs 318ms 11ms 1.1MB 310ms 0ms rustc 1.69.0
2.rs 355ms 11ms 1.1MB 343ms 0ms rustc 1.69.0
1.rs 426ms 8.1ms 1.0MB 417ms 0ms rustc 1.69.0

Input: 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4-i.rs 25ms 1.8ms 1.8MB 17ms 0ms rustc 1.69.0
3.rs 34ms 0.2ms 1.0MB 27ms 0ms rustc 1.71.0-nightly
7-i.rs 36ms 2.0ms 1.0MB 23ms 0ms rustc 1.69.0
2.rs 39ms 2.3ms 1.0MB 30ms 0ms rustc 1.69.0
1.rs 43ms 0.4ms 1.0MB 30ms 0ms rustc 1.69.0

spectral-norm

Input: 8000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
7-m.rs 935ms 40ms 2.3MB 1763ms 13ms rustc 1.69.0
8-m.rs 948ms 19ms 2.6MB 1777ms 7ms rustc 1.71.0-nightly
7.rs 1745ms 17ms 2.1MB 1733ms 0ms rustc 1.69.0
8.rs 1763ms 35ms 2.4MB 1750ms 0ms rustc 1.71.0-nightly
2-m.rs 1894ms 40ms 2.3MB 3620ms 23ms rustc 1.69.0
2.rs timeout 0.0ms 2.1MB 4987ms 0ms rustc 1.69.0

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
7-m.rs 242ms 10ms 1.0MB 440ms 3ms rustc 1.69.0
8-m.rs 244ms 4.2ms 2.3MB 443ms 0ms rustc 1.71.0-nightly
7.rs 440ms 6.1ms 1.1MB 430ms 0ms rustc 1.69.0
8.rs 445ms 17ms 2.2MB 433ms 0ms rustc 1.71.0-nightly
2-m.rs 518ms 7.6ms 2.0MB 943ms 13ms rustc 1.69.0
2.rs 1637ms 11ms 1.0MB 1623ms 0ms rustc 1.69.0

Input: 2000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
8-m.rs 67ms 2.6ms 1.1MB 107ms 0ms rustc 1.71.0-nightly
7-m.rs 70ms 2.0ms 1.0MB 110ms 0ms rustc 1.69.0
7.rs 113ms 4.7ms 1.0MB 103ms 0ms rustc 1.69.0
8.rs 122ms 6.4ms 1.1MB 113ms 0ms rustc 1.71.0-nightly
2-m.rs 133ms 4.2ms 2.2MB 227ms 0ms rustc 1.69.0
2.rs 428ms 4.5ms 1.0MB 417ms 0ms rustc 1.69.0

binarytrees

Input: 18

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4.rs 1896ms 31ms 33.6MB 1867ms 17ms rustc 1.69.0
5.rs 2004ms 36ms 33.9MB 1973ms 10ms rustc 1.69.0
3.rs 2057ms 41ms 49.9MB 2027ms 13ms rustc 1.69.0

Input: 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3.rs 170ms 0.7ms 7.8MB 157ms 0ms rustc 1.69.0
4.rs 173ms 6.5ms 5.7MB 160ms 0ms rustc 1.69.0
5.rs 176ms 4.0ms 5.7MB 163ms 0ms rustc 1.69.0

coro-prime-sieve

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3-m.rs 1015ms 80ms 6.3MB 1913ms 37ms rustc 1.69.0
5-m.rs 1214ms 291ms 4.4MB 2343ms 27ms rustc 1.69.0
3.rs 1977ms 21ms 6.2MB 1933ms 33ms rustc 1.69.0
4.rs 3023ms 49ms 4.4MB 3000ms 0ms rustc 1.69.0
1-m.rs 3639ms 18ms 4.9MB 7060ms 80ms rustc 1.69.0

Input: 1000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3-m.rs 84ms 1.6ms 3.0MB 140ms 0ms rustc 1.69.0
5-m.rs 119ms 31ms 2.7MB 197ms 10ms rustc 1.69.0
3.rs 121ms 3.7ms 3.1MB 107ms 0ms rustc 1.69.0
4.rs 210ms 17ms 2.3MB 200ms 0ms rustc 1.69.0
1-m.rs 249ms 2.4ms 2.9MB 443ms 10ms rustc 1.69.0

edigits

Input: 250001

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rs 144ms 3.3ms 3.6MB 133ms 0ms rustc 1.69.0
2.rs 593ms 16ms 3.8MB 580ms 0ms rustc 1.69.0

Input: 100000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rs 39ms 1.4ms 2.9MB 30ms 0ms rustc 1.69.0
2.rs 116ms 1.4ms 3.3MB 107ms 0ms rustc 1.69.0

fannkuch-redux

Input: 11

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3-im.rs 593ms 7.9ms 1.0MB 1127ms 10ms rustc 1.69.0
2-im.rs 928ms 16ms 1.0MB 1760ms 3ms rustc 1.69.0
5-m.rs 1196ms 14ms 1.1MB 2310ms 0ms rustc 1.69.0
3-i.rs 1240ms 26ms 1.0MB 1227ms 0ms rustc 1.69.0
2-i.rs 1810ms 5.2ms 1.9MB 1797ms 0ms rustc 1.69.0
1-m.rs 2459ms 83ms 1.0MB 4623ms 57ms rustc 1.69.0
1.rs 4008ms 19ms 1.0MB 3993ms 0ms rustc 1.69.0

Input: 10

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3-im.rs 58ms 2.5ms 1.0MB 87ms 0ms rustc 1.69.0
2-im.rs 86ms 3.1ms 1.0MB 140ms 0ms rustc 1.69.0
3-i.rs 105ms 1.1ms 1.1MB 90ms 0ms rustc 1.69.0
5-m.rs 111ms 0.8ms 1.0MB 193ms 0ms rustc 1.69.0
2-i.rs 156ms 6.4ms 1.1MB 147ms 0ms rustc 1.69.0
1-m.rs 226ms 15ms 1.0MB 383ms 7ms rustc 1.69.0
1.rs 348ms 9.9ms 1.0MB 333ms 0ms rustc 1.69.0

http-server

Input: 3000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rs 135ms 20ms 18.8MB 80ms 83ms rustc 1.69.0
2-http2.rs 362ms 54ms 39.4MB 447ms 140ms rustc 1.69.0
2-m.rs 599ms 31ms 99.1MB 313ms 593ms rustc 1.69.0
1-http2.rs 1073ms 257ms 59.9MB 1323ms 533ms rustc 1.69.0

Input: 500

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rs 74ms 15ms 13.9MB 10ms 40ms rustc 1.69.0
2.rs 143ms 15ms 23.4MB 43ms 103ms rustc 1.69.0
1-http2.rs 332ms 75ms 27.0MB 440ms 110ms rustc 1.69.0
2-http2.rs 377ms 38ms 29.0MB 523ms 127ms rustc 1.69.0

json-serde

Input: sample 5000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3.rs 86ms 0.3ms 36.3MB 67ms 3ms rustc 1.69.0
2.rs 90ms 3.2ms 38.0MB 60ms 17ms rustc 1.69.0
1.rs 156ms 4.2ms 75.4MB 107ms 37ms rustc 1.69.0

Input: canada 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3.rs 537ms 26ms 258.5MB 407ms 117ms rustc 1.69.0
2.rs 539ms 40ms 258.4MB 413ms 110ms rustc 1.69.0
1.rs 973ms 16ms 604.3MB 693ms 260ms rustc 1.69.0

knucleotide

Input: 2500000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
8-m.rs 371ms 7.5ms 29.1MB 637ms 17ms rustc 1.69.0
8.rs 638ms 20ms 24.1MB 617ms 7ms rustc 1.69.0

Input: 250000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
8-m.rs 53ms 2.4ms 16.3MB 70ms 0ms rustc 1.69.0
8.rs 80ms 0.2ms 11.4MB 60ms 7ms rustc 1.69.0

lru

Input: 1000 1000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
0-unsafe.rs 57ms 7.2ms 1.0MB 43ms 0ms rustc 1.69.0
1.rs 89ms 7.7ms 1.1MB 80ms 0ms rustc 1.69.0

Input: 1000 3000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
0-unsafe.rs 202ms 3.5ms 1.0MB 193ms 0ms rustc 1.69.0
1.rs 304ms 10ms 1.1MB 293ms 0ms rustc 1.69.0

Input: 100 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
0-unsafe.rs 34ms 1.5ms 1.8MB 20ms 0ms rustc 1.69.0
1.rs 53ms 2.0ms 1.0MB 40ms 0ms rustc 1.69.0

merkletrees

Input: 17

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rs 934ms 5.7ms 33.9MB 907ms 10ms rustc 1.69.0

Input: 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rs 196ms 6.1ms 9.8MB 177ms 3ms rustc 1.69.0

nsieve

Input: 12

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.rs 489ms 6.4ms 6.5MB 477ms 0ms rustc 1.69.0
1.rs 1424ms 21ms 41.0MB 1387ms 13ms rustc 1.69.0

Input: 10

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.rs 111ms 6.4ms 3.2MB 97ms 0ms rustc 1.69.0
1.rs 145ms 0.2ms 11.7MB 127ms 0ms rustc 1.69.0

pidigits

Input: 8000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.rs 1650ms 0.8ms 2.7MB 1593ms 43ms rustc 1.69.0
1.rs 1705ms 15ms 2.7MB 1563ms 123ms rustc 1.69.0

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rs 367ms 1.0ms 2.6MB 343ms 7ms rustc 1.69.0
2.rs 373ms 1.4ms 2.6MB 357ms 0ms rustc 1.69.0

regex-redux

Input: 2500000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
7.rs 606ms 7.8ms 77.3MB 677ms 20ms rustc 1.69.0

Input: 250000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
7.rs 65ms 1.7ms 11.7MB 63ms 0ms rustc 1.69.0

secp256k1

Input: 2000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
0.rs 140ms 3.8ms 1.1MB 127ms 0ms rustc 1.69.0
1.rs 1873ms 6.4ms 1.0MB 1863ms 0ms rustc 1.69.0

Input: 500

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
0.rs 39ms 0.8ms 1.9MB 30ms 0ms rustc 1.69.0
1.rs 472ms 2.8ms 1.0MB 460ms 0ms rustc 1.69.0