All Nim 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.)

binarytrees

Input: 18

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.nim 2118ms 4.0ms 34.6MB 2093ms 7ms nim/clang 1.6.10
2.nim 2126ms 0.4ms 34.8MB 2107ms 3ms nim 1.6.10

Input: 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.nim 201ms 0.2ms 5.7MB 190ms 0ms nim/clang 1.6.10
2.nim 202ms 1.4ms 5.5MB 190ms 0ms nim 1.6.10

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.10
1.nim timeout 0.0ms 0.0MB 0ms 0ms nim/clang 1.6.10

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.10
1.nim timeout 0.0ms 0.0MB 0ms 0ms nim/clang 1.6.10

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.10
1.nim timeout 0.0ms 0.0MB 0ms 0ms nim/clang 1.6.10

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.10
1.nim timeout 0.0ms 0.0MB 0ms 0ms nim/clang 1.6.10

fasta

Input: 2500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.nim 241ms 0.8ms 1.1MB 230ms 0ms nim 1.6.10
2.nim 308ms 1.3ms 1.3MB 297ms 0ms nim/clang 1.6.10
1.nim 689ms 0.5ms 1.3MB 583ms 87ms nim/clang 1.6.10
1.nim 708ms 0.8ms 1.1MB 613ms 77ms nim 1.6.10

Input: 250000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.nim 27ms 0.5ms 1.0MB 20ms 0ms nim 1.6.10
2.nim 32ms 0.1ms 1.2MB 23ms 0ms nim/clang 1.6.10
1.nim 73ms 3.0ms 1.2MB 50ms 3ms nim/clang 1.6.10
1.nim 73ms 0.9ms 1.0MB 57ms 3ms nim 1.6.10

helloworld

Input: QwQ

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim 1.8ms 0.6ms 1.2MB 0ms 0ms nim/clang 1.6.10
1.nim 2.0ms 1.0ms 1.0MB 0ms 0ms nim 1.6.10

http-server

Input: 3000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim 832ms 12ms 94.7MB 373ms 423ms nim/clang 1.6.10
1.nim 836ms 2.8ms 94.5MB 407ms 397ms nim 1.6.10

Input: 500

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim 136ms 1.9ms 17.9MB 47ms 67ms nim 1.6.10
1.nim 137ms 0.7ms 18.0MB 57ms 63ms nim/clang 1.6.10

lru

Input: 1000 1000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.nim 149ms 1.0ms 1.2MB 140ms 0ms nim/clang 1.6.10
2.nim 152ms 0.4ms 1.0MB 140ms 0ms nim 1.6.10
1.nim timeout 0.0ms 0.0MB 0ms 0ms nim 1.6.10
1.nim timeout 0.0ms 0.0MB 0ms 0ms nim/clang 1.6.10

Input: 1000 3000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.nim 440ms 0.8ms 1.3MB 427ms 3ms nim/clang 1.6.10
2.nim 451ms 1.0ms 1.7MB 440ms 0ms nim 1.6.10
1.nim timeout 0.0ms 0.0MB 0ms 0ms nim 1.6.10
1.nim timeout 0.0ms 0.0MB 0ms 0ms nim/clang 1.6.10

Input: 100 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.nim 65ms 0.9ms 1.3MB 53ms 0ms nim/clang 1.6.10
2.nim 66ms 0.2ms 1.0MB 60ms 0ms nim 1.6.10
1.nim 386ms 3.4ms 1.3MB 377ms 0ms nim/clang 1.6.10
1.nim 429ms 24ms 1.0MB 417ms 0ms nim 1.6.10

mandelbrot

Input: 5000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim 582ms 0.8ms 4.8MB 570ms 0ms nim/clang 1.6.10
1.nim 867ms 2.3ms 4.5MB 853ms 0ms nim 1.6.10

Input: 1000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim 27ms 0.2ms 1.3MB 20ms 0ms nim/clang 1.6.10
1.nim 38ms 0.7ms 1.1MB 30ms 0ms nim 1.6.10

merkletrees

Input: 17

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim 1080ms 12ms 34.9MB 1060ms 0ms nim/clang 1.6.10
1.nim 1083ms 3.5ms 33.9MB 1060ms 7ms nim 1.6.10

Input: 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim 228ms 0.5ms 9.5MB 213ms 0ms nim/clang 1.6.10
1.nim 230ms 0.3ms 9.3MB 217ms 0ms nim 1.6.10

nbody

Input: 5000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.nim 403ms 0.4ms 1.4MB 390ms 0ms nim 1.6.10
2.nim 412ms 1.8ms 1.3MB 400ms 0ms nim/clang 1.6.10

Input: 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.nim 42ms 0.4ms 1.3MB 30ms 0ms nim 1.6.10
2.nim 43ms 0.4ms 2.1MB 30ms 0ms nim/clang 1.6.10

nsieve

Input: 12

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.nim 664ms 0.5ms 6.3MB 650ms 0ms nim/clang 1.6.10
1.nim 821ms 18ms 40.8MB 800ms 3ms nim/clang 1.6.10
2.nim 830ms 0.7ms 6.0MB 820ms 0ms nim 1.6.10
1.nim 833ms 4.9ms 40.7MB 813ms 3ms nim 1.6.10

Input: 10

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim 130ms 1.2ms 11.1MB 120ms 0ms nim 1.6.10
1.nim 130ms 0.9ms 11.6MB 120ms 0ms nim/clang 1.6.10
2.nim 151ms 0.7ms 3.3MB 140ms 0ms nim/clang 1.6.10
2.nim 196ms 0.1ms 3.1MB 183ms 0ms nim 1.6.10

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.10
1.nim timeout 0.0ms 0.0MB 0ms 0ms nim/clang 1.6.10

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.10
1.nim timeout 0.0ms 0.0MB 0ms 0ms nim/clang 1.6.10

regex-redux

Input: 2500000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim 2418ms 1.0ms 167.9MB 2357ms 43ms nim/clang 1.6.10
1.nim 2472ms 1.6ms 167.0MB 2403ms 47ms nim 1.6.10

Input: 250000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim 247ms 3.6ms 17.1MB 230ms 0ms nim/clang 1.6.10
1.nim 251ms 0.6ms 16.8MB 233ms 0ms nim 1.6.10

spectral-norm

Input: 8000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim 3431ms 1.2ms 1.3MB 3420ms 0ms nim/clang 1.6.10
1.nim 3434ms 2.2ms 1.3MB 3420ms 0ms nim 1.6.10

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim 861ms 0.5ms 1.2MB 850ms 0ms nim/clang 1.6.10
1.nim 861ms 1.7ms 1.3MB 850ms 0ms nim 1.6.10

Input: 2000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.nim 217ms 0.0ms 1.3MB 203ms 0ms nim 1.6.10
1.nim 218ms 0.5ms 1.2MB 207ms 0ms nim/clang 1.6.10