All Nim benchmarks

Current benchmark data was generated on Fri Jul 01 2022, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][2 cores] Intel(R) Xeon(R) Platinum 8171M 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.)

binarytrees

Input: 18

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.nim 3956ms 39ms 34.9MB 3927ms 10ms nim 1.6.6
2.nim 4104ms 38ms 34.6MB 4073ms 10ms nim/clang 1.6.6

Input: 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.nim 370ms 5.1ms 5.4MB 357ms 0ms nim 1.6.6
2.nim 385ms 1.2ms 5.7MB 373ms 0ms nim/clang 1.6.6

coro-prime-sieve

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim timeout 0.0ms 0.0MB 0ms 0ms nim 1.6.6
1.nim timeout 0.0ms 0.0MB 0ms 0ms nim/clang 1.6.6

Input: 1000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim timeout 0.0ms 0.0MB 0ms 0ms nim 1.6.6
1.nim timeout 0.0ms 0.0MB 0ms 0ms nim/clang 1.6.6

edigits

Input: 250001

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim timeout 0.0ms 0.0MB 0ms 0ms nim 1.6.6
1.nim timeout 0.0ms 0.0MB 0ms 0ms nim/clang 1.6.6

Input: 100000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim timeout 0.0ms 0.0MB 0ms 0ms nim 1.6.6
1.nim timeout 0.0ms 0.0MB 0ms 0ms nim/clang 1.6.6

fasta

Input: 2500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.nim 307ms 9.7ms 0.7MB 293ms 0ms nim 1.6.6
2.nim 359ms 1.6ms 1.0MB 347ms 0ms nim/clang 1.6.6
1.nim 861ms 3.3ms 0.7MB 750ms 93ms nim 1.6.6
1.nim 885ms 2.5ms 1.0MB 773ms 93ms nim/clang 1.6.6

Input: 250000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.nim 33ms 0.6ms 0.7MB 23ms 0ms nim 1.6.6
2.nim 39ms 0.3ms 1.0MB 30ms 0ms nim/clang 1.6.6
1.nim 89ms 0.2ms 0.7MB 63ms 10ms nim 1.6.6
1.nim 103ms 4.4ms 0.9MB 73ms 13ms nim/clang 1.6.6

helloworld

Input: QwQ

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim 2.0ms 0.8ms 0.7MB 0ms 0ms nim 1.6.6
1.nim 2.5ms 0.6ms 0.9MB 0ms 0ms nim/clang 1.6.6

http-server

Input: 3000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim 1017ms 1.0ms 94.4MB 520ms 463ms nim/clang 1.6.6
1.nim 1042ms 17ms 94.4MB 540ms 463ms nim 1.6.6

Input: 500

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim 160ms 4.1ms 18.7MB 60ms 80ms nim/clang 1.6.6
1.nim 171ms 6.3ms 18.4MB 70ms 83ms nim 1.6.6

lru

Input: 1000 1000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.nim 183ms 2.4ms 1.0MB 170ms 0ms nim/clang 1.6.6
2.nim 198ms 3.2ms 0.7MB 190ms 0ms nim 1.6.6
1.nim timeout 0.0ms 0.0MB 0ms 0ms nim 1.6.6
1.nim timeout 0.0ms 0.0MB 0ms 0ms nim/clang 1.6.6

Input: 1000 3000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.nim 540ms 7.8ms 0.9MB 530ms 0ms nim/clang 1.6.6
2.nim 576ms 5.3ms 0.7MB 567ms 0ms nim 1.6.6
1.nim timeout 0.0ms 0.0MB 0ms 0ms nim 1.6.6
1.nim timeout 0.0ms 0.0MB 0ms 0ms nim/clang 1.6.6

Input: 100 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.nim 78ms 0.5ms 1.0MB 70ms 0ms nim/clang 1.6.6
2.nim 87ms 3.9ms 0.7MB 77ms 0ms nim 1.6.6
1.nim 585ms 16ms 0.7MB 573ms 0ms nim 1.6.6
1.nim 593ms 2.6ms 0.9MB 580ms 0ms nim/clang 1.6.6

mandelbrot

Input: 5000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim 624ms 6.7ms 4.7MB 610ms 0ms nim/clang 1.6.6
1.nim 1083ms 7.3ms 4.5MB 1067ms 0ms nim 1.6.6

Input: 1000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim 32ms 3.5ms 1.0MB 20ms 0ms nim/clang 1.6.6
1.nim 47ms 0.8ms 0.7MB 40ms 0ms nim 1.6.6

merkletrees

Input: 17

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim 1900ms 13ms 34.8MB 1873ms 7ms nim 1.6.6
1.nim 1944ms 15ms 35.1MB 1917ms 10ms nim/clang 1.6.6

Input: 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim 407ms 5.1ms 9.3MB 390ms 0ms nim 1.6.6
1.nim 412ms 2.6ms 9.5MB 397ms 0ms nim/clang 1.6.6

nbody

Input: 5000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.nim 522ms 2.6ms 0.9MB 510ms 0ms nim/clang 1.6.6
2.nim 539ms 7.2ms 1.0MB 527ms 0ms nim 1.6.6

Input: 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.nim 57ms 1.9ms 0.9MB 47ms 0ms nim 1.6.6
2.nim 62ms 2.6ms 1.0MB 50ms 0ms nim/clang 1.6.6

nsieve

Input: 12

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.nim 798ms 9.7ms 6.7MB 783ms 0ms nim/clang 1.6.6
2.nim 951ms 2.6ms 6.0MB 937ms 0ms nim 1.6.6
1.nim 1200ms 80ms 40.9MB 1173ms 10ms nim 1.6.6
1.nim 1213ms 22ms 41.3MB 1187ms 7ms nim/clang 1.6.6

Input: 10

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim 147ms 3.8ms 11.6MB 130ms 0ms nim/clang 1.6.6
1.nim 159ms 6.5ms 11.4MB 147ms 0ms nim 1.6.6
2.nim 186ms 2.2ms 3.3MB 170ms 0ms nim/clang 1.6.6
2.nim 223ms 3.7ms 3.0MB 213ms 0ms nim 1.6.6

pidigits

Input: 8000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim timeout 0.0ms 0.0MB 0ms 0ms nim 1.6.6
1.nim timeout 0.0ms 0.0MB 0ms 0ms nim/clang 1.6.6

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim timeout 0.0ms 0.0MB 0ms 0ms nim 1.6.6
1.nim timeout 0.0ms 0.0MB 0ms 0ms nim/clang 1.6.6

spectral-norm

Input: 8000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim 4223ms 14ms 1.8MB 4210ms 0ms nim/clang 1.6.6
1.nim 4233ms 6.9ms 1.9MB 4217ms 0ms nim 1.6.6

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim 1057ms 14ms 0.9MB 1040ms 0ms nim/clang 1.6.6
1.nim 1058ms 1.7ms 0.9MB 1047ms 0ms nim 1.6.6

Input: 2000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim 266ms 2.2ms 0.9MB 253ms 0ms nim 1.6.6
1.nim 269ms 7.6ms 1.0MB 257ms 0ms nim/clang 1.6.6