Rust VS V benchmarks

Current benchmark data was generated on Thu May 01 2025, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][4 cores] AMD EPYC 7763 64-Core Processor (Model 1)

* -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
v 1.v 1.0ms 0.0ms 1.4MB 0ms 0ms v/clang 0.4.10
rust 1.rs 1.2ms 0.0ms 1.8MB 0ms 0ms rustc 1.86.0
v 1.v 1.4ms 0.1ms 1.9MB 0ms 0ms v/clang+gc 0.4.10
rust 1.rs 1.5ms 0.3ms 1.8MB 0ms 0ms rustc 1.88.0-nightly

mandelbrot

Input: 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 9.rs 246ms 0.4ms 4.8MB 233ms 0ms rustc 1.88.0-nightly
rust 8.rs 292ms 2.2ms 4.9MB 283ms 0ms rustc 1.86.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 9.rs 13ms 0.2ms 1.9MB 10ms 0ms rustc 1.88.0-nightly
rust 8.rs 14ms 0.2ms 2.0MB 10ms 0ms rustc 1.86.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 4-i.rs 166ms 3.7ms 1.9MB 157ms 0ms rustc 1.86.0
rust 1.rs 238ms 0.2ms 1.8MB 230ms 0ms rustc 1.86.0
rust 7-i.rs 239ms 2.5ms 1.8MB 230ms 0ms rustc 1.86.0
rust 3.rs 279ms 1.0ms 1.8MB 270ms 0ms rustc 1.88.0-nightly
rust 2.rs 284ms 1.0ms 1.6MB 273ms 0ms rustc 1.86.0
v 1.v 311ms 1.2ms 1.6MB 300ms 0ms v/clang 0.4.10
v 1.v 311ms 0.2ms 2.3MB 300ms 0ms v/clang+gc 0.4.10

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 4-i.rs 18ms 0.1ms 1.8MB 10ms 0ms rustc 1.86.0
rust 1.rs 26ms 0.2ms 1.9MB 20ms 0ms rustc 1.86.0
rust 7-i.rs 26ms 0.1ms 1.9MB 20ms 0ms rustc 1.86.0
rust 3.rs 30ms 0.1ms 1.8MB 20ms 0ms rustc 1.88.0-nightly
rust 2.rs 31ms 0.1ms 1.6MB 20ms 0ms rustc 1.86.0
v 1.v 34ms 0.4ms 1.6MB 30ms 0ms v/clang 0.4.10
v 1.v 34ms 0.1ms 2.3MB 27ms 0ms v/clang+gc 0.4.10

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 8-m.rs 492ms 0.2ms 2.5MB 1903ms 3ms rustc 1.88.0-nightly
rust 7-m.rs 501ms 0.3ms 2.1MB 1940ms 0ms rustc 1.86.0
rust 8.rs 992ms 0.2ms 2.5MB 980ms 0ms rustc 1.88.0-nightly
rust 2-m.rs 1958ms 7.1ms 2.3MB 7653ms 3ms rustc 1.86.0
rust 7.rs 2070ms 8.8ms 1.9MB 2060ms 0ms rustc 1.86.0
rust 2.rs 4205ms 2.7ms 2.0MB 4197ms 0ms rustc 1.86.0
v 1.v timeout 0.0ms 1.6MB 4990ms 0ms v/clang 0.4.10
v 1.v timeout 0.0ms 2.8MB 4990ms 0ms v/clang+gc 0.4.10

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 8-m.rs 127ms 0.7ms 2.3MB 467ms 3ms rustc 1.88.0-nightly
rust 7-m.rs 129ms 0.3ms 2.3MB 477ms 3ms rustc 1.86.0
rust 8.rs 251ms 1.3ms 2.1MB 240ms 0ms rustc 1.88.0-nightly
rust 2-m.rs 492ms 0.4ms 2.3MB 1903ms 3ms rustc 1.86.0
rust 7.rs 517ms 2.2ms 1.9MB 510ms 0ms rustc 1.86.0
rust 2.rs 1053ms 0.4ms 2.0MB 1043ms 0ms rustc 1.86.0
v 1.v 1286ms 2.9ms 1.5MB 1277ms 0ms v/clang 0.4.10
v 1.v 1297ms 1.5ms 2.5MB 1290ms 0ms v/clang+gc 0.4.10

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 8-m.rs 35ms 0.0ms 2.1MB 110ms 0ms rustc 1.88.0-nightly
rust 7-m.rs 36ms 0.1ms 2.1MB 113ms 0ms rustc 1.86.0
rust 8.rs 65ms 0.1ms 2.0MB 60ms 0ms rustc 1.88.0-nightly
rust 2-m.rs 127ms 0.2ms 2.1MB 470ms 0ms rustc 1.86.0
rust 7.rs 133ms 2.9ms 1.8MB 123ms 0ms rustc 1.86.0
rust 2.rs 266ms 1.6ms 2.0MB 257ms 0ms rustc 1.86.0
v 1.v 324ms 0.5ms 1.5MB 313ms 0ms v/clang 0.4.10
v 1.v 326ms 0.3ms 2.5MB 317ms 0ms v/clang+gc 0.4.10

binarytrees

Input: 18

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 768ms 17ms 28.9MB 750ms 0ms v/clang+gc 0.4.10
rust 4.rs 1262ms 11ms 33.8MB 1240ms 10ms rustc 1.86.0
rust 5.rs 1330ms 3.4ms 33.8MB 1307ms 13ms rustc 1.86.0
rust 3.rs 1471ms 55ms 49.8MB 1440ms 17ms rustc 1.86.0
v 1.v 2185ms 4.8ms 2086.6MB 1287ms 883ms v/clang 0.4.10

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 71ms 2.4ms 4.6MB 60ms 0ms v/clang+gc 0.4.10
rust 4.rs 121ms 0.2ms 5.8MB 110ms 0ms rustc 1.86.0
rust 5.rs 128ms 0.5ms 5.8MB 120ms 0ms rustc 1.86.0
rust 3.rs 137ms 9.7ms 7.8MB 123ms 0ms rustc 1.86.0
v 1.v 210ms 2.0ms 197.8MB 120ms 77ms v/clang 0.4.10

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 3-m.rs 536ms 39ms 9.1MB 2017ms 67ms rustc 1.86.0
rust 5-m.rs 631ms 109ms 5.8MB 2383ms 60ms rustc 1.86.0
rust 1-m.rs 929ms 2.1ms 7.3MB 3410ms 223ms rustc 1.86.0
rust 3.rs 1120ms 2.0ms 9.3MB 1080ms 27ms rustc 1.86.0
rust 4.rs 1843ms 14ms 6.9MB 1833ms 0ms rustc 1.86.0
v 1.v timeout 0.0ms 17.6MB 8397ms 11117ms v/clang 0.4.10
v 1.v timeout 0.0ms 18.0MB 8957ms 10320ms v/clang+gc 0.4.10

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 5-m.rs 54ms 1.6ms 3.5MB 163ms 10ms rustc 1.86.0
rust 3-m.rs 57ms 2.5ms 4.3MB 183ms 7ms rustc 1.86.0
rust 3.rs 71ms 1.8ms 4.0MB 60ms 0ms rustc 1.86.0
rust 1-m.rs 72ms 0.4ms 3.5MB 223ms 27ms rustc 1.86.0
rust 4.rs 114ms 2.2ms 3.1MB 107ms 0ms rustc 1.86.0
v 1-m.v 1412ms 30ms 9.8MB 2280ms 3097ms v/clang 0.4.10
v 1-m.v 1430ms 41ms 10.3MB 2463ms 2910ms v/clang+gc 0.4.10

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1.rs 116ms 0.2ms 3.6MB 110ms 0ms rustc 1.86.0
rust 2.rs 422ms 2.6ms 3.6MB 410ms 0ms rustc 1.86.0
v 1.v timeout 0.0ms 8.5MB 4990ms 0ms v/clang+gc 0.4.10

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1.rs 33ms 1.1ms 2.9MB 27ms 0ms rustc 1.86.0
rust 2.rs 76ms 0.0ms 3.0MB 70ms 0ms rustc 1.86.0
v 1.v timeout 0.0ms 4.6MB 4990ms 0ms v/clang+gc 0.4.10

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 3-im.rs 410ms 1.6ms 2.0MB 1577ms 0ms rustc 1.86.0
rust 5-m.rs 570ms 3.6ms 2.1MB 2180ms 0ms rustc 1.86.0
rust 2-im.rs 631ms 5.8ms 2.0MB 2437ms 0ms rustc 1.86.0
rust 1-m.rs 973ms 3.3ms 2.1MB 3763ms 0ms rustc 1.86.0
rust 3-i.rs 1500ms 0.7ms 1.9MB 1490ms 0ms rustc 1.86.0
rust 2-i.rs 1768ms 1.0ms 1.8MB 1760ms 0ms rustc 1.86.0
v 1.v 2229ms 4.9ms 1.9MB 2223ms 0ms v/clang+gc 0.4.10
v 1.v 2257ms 3.9ms 1.1MB 2247ms 0ms v/clang 0.4.10
rust 1.rs 2689ms 13ms 1.8MB 2683ms 0ms rustc 1.86.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 3-im.rs 38ms 0.3ms 2.0MB 123ms 0ms rustc 1.86.0
rust 5-m.rs 53ms 0.5ms 2.1MB 170ms 0ms rustc 1.86.0
rust 2-im.rs 59ms 1.0ms 2.1MB 200ms 0ms rustc 1.86.0
rust 1-m.rs 86ms 2.3ms 2.1MB 300ms 0ms rustc 1.86.0
rust 3-i.rs 124ms 0.1ms 1.9MB 120ms 0ms rustc 1.86.0
rust 2-i.rs 150ms 0.3ms 1.8MB 140ms 0ms rustc 1.86.0
v 1.v 190ms 2.3ms 1.9MB 180ms 0ms v/clang+gc 0.4.10
v 1.v 192ms 1.9ms 1.1MB 180ms 0ms v/clang 0.4.10
rust 1.rs 229ms 0.6ms 1.8MB 220ms 0ms rustc 1.86.0

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 5c-m.rs 88ms 0.2ms 3.2MB 247ms 0ms rustc 1.86.0
rust 5-m.rs 91ms 1.2ms 3.2MB 273ms 0ms rustc 1.86.0
rust 6.rs 143ms 0.1ms 1.9MB 133ms 0ms rustc 1.86.0
rust 1c.rs 163ms 0.6ms 1.8MB 150ms 0ms rustc 1.86.0
rust 1.rs 194ms 1.0ms 2.0MB 187ms 0ms rustc 1.86.0
v 1.v 501ms 1.9ms 1.3MB 490ms 0ms v/clang 0.4.10
v 1.v 513ms 3.6ms 2.1MB 507ms 0ms v/clang+gc 0.4.10

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 5-m.rs 16ms 0.2ms 3.2MB 30ms 0ms rustc 1.86.0
rust 5c-m.rs 16ms 0.5ms 3.2MB 20ms 0ms rustc 1.86.0
rust 6.rs 17ms 0.2ms 1.9MB 10ms 0ms rustc 1.86.0
rust 1c.rs 19ms 0.2ms 1.9MB 10ms 0ms rustc 1.86.0
rust 1.rs 22ms 0.4ms 1.9MB 10ms 0ms rustc 1.86.0
v 1.v 54ms 1.9ms 1.3MB 43ms 0ms v/clang 0.4.10
v 1.v 55ms 2.1ms 2.1MB 50ms 0ms v/clang+gc 0.4.10

http-server

Input: 3000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1-m.rs 341ms 25ms 86.5MB 167ms 537ms rustc 1.86.0
rust 2-http2.rs 380ms 116ms 58.1MB 863ms 420ms rustc 1.86.0
rust 2-m.rs 408ms 17ms 74.1MB 240ms 863ms rustc 1.86.0
rust 1-http2.rs 781ms 162ms 68.1MB 2147ms 687ms rustc 1.86.0

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1-m.rs 48ms 1.8ms 15.8MB 13ms 73ms rustc 1.86.0
rust 2-m.rs 79ms 2.0ms 21.1MB 37ms 163ms rustc 1.86.0
rust 1-http2.rs 227ms 53ms 27.1MB 590ms 193ms rustc 1.86.0
rust 2-http2.rs 230ms 60ms 28.9MB 603ms 187ms rustc 1.86.0

json-serde

Input: sample 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 5-i.rs 29ms 1.5ms 9.8MB 17ms 0ms rustc 1.86.0
rust 4-i.rs 31ms 1.5ms 7.9MB 20ms 0ms rustc 1.86.0
rust 3.rs 61ms 2.6ms 32.0MB 40ms 10ms rustc 1.86.0
rust 2.rs 62ms 2.6ms 33.8MB 40ms 10ms rustc 1.86.0
rust 1.rs 100ms 1.5ms 67.4MB 57ms 30ms rustc 1.86.0

Input: canada 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 5-i.rs 211ms 3.5ms 53.3MB 190ms 10ms rustc 1.86.0
rust 4-i.rs 259ms 3.8ms 53.7MB 203ms 43ms rustc 1.86.0
rust 3.rs 405ms 1.1ms 237.8MB 303ms 90ms rustc 1.86.0
rust 2.rs 413ms 5.8ms 237.8MB 307ms 93ms rustc 1.86.0
rust 1.rs 695ms 12ms 551.8MB 450ms 227ms rustc 1.86.0

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 8-m.rs 228ms 13ms 28.8MB 660ms 10ms rustc 1.86.0
rust 8.rs 479ms 15ms 24.4MB 460ms 3ms rustc 1.86.0

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 8-m.rs 29ms 2.0ms 16.7MB 63ms 3ms rustc 1.86.0
rust 8.rs 61ms 1.2ms 11.4MB 50ms 0ms rustc 1.86.0

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 0-unsafe.rs 41ms 7.1ms 1.9MB 33ms 0ms rustc 1.86.0
rust 1.rs 47ms 6.4ms 2.0MB 40ms 0ms rustc 1.86.0
v 1.v 249ms 4.0ms 1.3MB 240ms 0ms v/clang 0.4.10
v 1.v 261ms 4.7ms 2.1MB 253ms 0ms v/clang+gc 0.4.10

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 0-unsafe.rs 136ms 3.5ms 1.8MB 127ms 0ms rustc 1.86.0
rust 1.rs 199ms 9.5ms 1.9MB 190ms 0ms rustc 1.86.0
v 1.v 760ms 5.8ms 1.3MB 753ms 0ms v/clang 0.4.10
v 1.v 777ms 4.7ms 2.1MB 767ms 0ms v/clang+gc 0.4.10

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 0-unsafe.rs 23ms 0.2ms 1.8MB 13ms 0ms rustc 1.86.0
rust 1.rs 30ms 1.2ms 1.8MB 20ms 0ms rustc 1.86.0
v 1.v 89ms 0.3ms 1.5MB 80ms 0ms v/clang 0.4.10
v 1.v 100ms 1.7ms 2.1MB 90ms 0ms v/clang+gc 0.4.10

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1.rs 700ms 11ms 33.8MB 677ms 7ms rustc 1.86.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1.rs 151ms 3.1ms 9.8MB 140ms 0ms rustc 1.86.0

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 305ms 4.9ms 40.3MB 287ms 0ms v/clang 0.4.10
v 1.v 312ms 1.2ms 60.6MB 297ms 0ms v/clang+gc 0.4.10
rust 2.rs 324ms 2.1ms 6.6MB 313ms 0ms rustc 1.86.0
v 2.v 333ms 3.9ms 6.1MB 323ms 0ms v/clang 0.4.10
v 2.v 338ms 1.5ms 6.9MB 330ms 0ms v/clang+gc 0.4.10
rust 1.rs 342ms 6.1ms 40.9MB 327ms 3ms rustc 1.86.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 60ms 2.6ms 11.9MB 50ms 0ms v/clang+gc 0.4.10
v 1.v 61ms 3.4ms 11.0MB 50ms 0ms v/clang 0.4.10
rust 1.rs 73ms 3.7ms 11.6MB 63ms 0ms rustc 1.86.0
rust 2.rs 82ms 1.1ms 3.0MB 70ms 0ms rustc 1.86.0
v 2.v 82ms 1.3ms 3.1MB 73ms 0ms v/clang+gc 0.4.10
v 2.v 83ms 2.2ms 2.4MB 77ms 0ms v/clang 0.4.10

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1.rs 1506ms 3.3ms 2.7MB 1293ms 193ms rustc 1.86.0
rust 2.rs 1713ms 6.7ms 2.7MB 1627ms 73ms rustc 1.86.0
v 2.v 3213ms 64ms 3.3MB 3193ms 7ms v/clang+gc 0.4.10

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1.rs 314ms 0.1ms 2.4MB 290ms 10ms rustc 1.86.0
rust 2.rs 383ms 4.0ms 2.4MB 373ms 0ms rustc 1.86.0
v 2.v 789ms 5.6ms 2.6MB 777ms 0ms v/clang+gc 0.4.10

regex-redux

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 7.rs 440ms 1.3ms 78.6MB 447ms 13ms rustc 1.86.0
v 1.v timeout 0.0ms 83.1MB 4980ms 7ms v/clang+gc 0.4.10

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 7.rs 50ms 0.5ms 11.6MB 40ms 0ms rustc 1.86.0
v 1.v 3514ms 101ms 26.0MB 3497ms 0ms v/clang+gc 0.4.10

secp256k1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 0.rs 119ms 2.6ms 1.8MB 110ms 0ms rustc 1.86.0
rust 1.rs 1431ms 8.3ms 1.9MB 1423ms 0ms rustc 1.86.0

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 0.rs 31ms 0.9ms 1.9MB 20ms 0ms rustc 1.86.0
rust 1.rs 367ms 3.1ms 1.9MB 357ms 0ms rustc 1.86.0