Nim VS Acton benchmarks

Current benchmark data was generated on Wed Mar 22 2023, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][2 cores] Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz (Model 106)

* -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

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 2.nim 1968ms 8.3ms 34.7MB 1950ms 3ms nim 1.6.12
nim 2.nim 2100ms 25ms 34.8MB 2080ms 3ms nim/clang 1.6.12

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 2.nim 184ms 0.6ms 5.5MB 170ms 0ms nim 1.6.12
nim 2.nim 196ms 1.9ms 5.7MB 183ms 0ms nim/clang 1.6.12

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 1.nim timeout 0.0ms 420.9MB 3417ms 1237ms nim 1.6.12
nim 1.nim timeout 0.0ms 423.2MB 3360ms 1290ms nim/clang 1.6.12

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 1.nim timeout 0.0ms 421.6MB 3393ms 1257ms nim 1.6.12
nim 1.nim timeout 0.0ms 422.4MB 3427ms 1223ms nim/clang 1.6.12

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
acton 1.act 539ms 20ms 7.4MB 490ms 20ms actonc 0.14.2
nim 1.nim timeout 0.0ms 3.0MB 4983ms 0ms nim 1.6.12
nim 1.nim timeout 0.0ms 3.0MB 4980ms 0ms nim/clang 1.6.12

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
acton 1.act 235ms 21ms 5.3MB 195ms 0ms actonc 0.14.2
nim 1.nim timeout 0.0ms 2.2MB 4990ms 0ms nim 1.6.12
nim 1.nim timeout 0.0ms 2.2MB 4987ms 0ms nim/clang 1.6.12

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 2.nim 270ms 1.1ms 1.0MB 253ms 3ms nim 1.6.12
nim 2.nim 337ms 0.8ms 1.3MB 323ms 0ms nim/clang 1.6.12
nim 1.nim 780ms 1.0ms 1.0MB 673ms 87ms nim 1.6.12
nim 1.nim 807ms 1.4ms 1.3MB 690ms 100ms nim/clang 1.6.12

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 2.nim 29ms 0.6ms 1.0MB 20ms 0ms nim 1.6.12
nim 2.nim 37ms 1.6ms 1.3MB 30ms 0ms nim/clang 1.6.12
nim 1.nim 81ms 0.8ms 1.1MB 63ms 3ms nim 1.6.12
nim 1.nim 84ms 0.9ms 1.3MB 60ms 3ms nim/clang 1.6.12

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 1.nim 2.1ms 1.0ms 1.0MB 0ms 0ms nim 1.6.12
nim 1.nim 2.2ms 0.9ms 1.2MB 0ms 0ms nim/clang 1.6.12
acton 1.act 8.0ms 3.1ms 3.4MB 0ms 0ms actonc 0.14.2

http-server

Input: 3000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 1.nim 765ms 1.1ms 93.8MB 337ms 393ms nim/clang 1.6.12
nim 1.nim 780ms 1.2ms 94.1MB 310ms 433ms nim 1.6.12

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 1.nim 131ms 1.0ms 18.0MB 43ms 67ms nim/clang 1.6.12
nim 1.nim 132ms 1.0ms 18.3MB 50ms 63ms nim 1.6.12

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 2.nim 145ms 1.5ms 1.2MB 140ms 0ms nim/clang 1.6.12
nim 2.nim 152ms 0.8ms 1.0MB 140ms 0ms nim 1.6.12
nim 1.nim timeout 0.0ms 1.0MB 4990ms 0ms nim 1.6.12
nim 1.nim timeout 0.0ms 1.2MB 4990ms 0ms nim/clang 1.6.12

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 2.nim 430ms 1.5ms 1.2MB 420ms 0ms nim/clang 1.6.12
nim 2.nim 447ms 0.6ms 1.1MB 437ms 0ms nim 1.6.12
nim 1.nim timeout 0.0ms 1.1MB 4990ms 0ms nim 1.6.12
nim 1.nim timeout 0.0ms 1.2MB 4990ms 0ms nim/clang 1.6.12

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 2.nim 63ms 0.3ms 1.3MB 50ms 0ms nim/clang 1.6.12
nim 2.nim 66ms 1.8ms 1.0MB 57ms 0ms nim 1.6.12
nim 1.nim 385ms 0.6ms 1.3MB 373ms 0ms nim/clang 1.6.12
nim 1.nim 437ms 0.8ms 1.0MB 430ms 0ms nim 1.6.12

mandelbrot

Input: 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 1.nim 657ms 0.6ms 4.7MB 650ms 0ms nim/clang 1.6.12
nim 1.nim 985ms 1.7ms 4.5MB 970ms 0ms nim 1.6.12

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 1.nim 30ms 0.6ms 1.3MB 20ms 0ms nim/clang 1.6.12
nim 1.nim 44ms 0.8ms 1.1MB 37ms 0ms nim 1.6.12

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 1.nim 1014ms 3.2ms 34.6MB 990ms 7ms nim 1.6.12
nim 1.nim 1035ms 1.8ms 34.9MB 1010ms 7ms nim/clang 1.6.12

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 1.nim 214ms 0.9ms 9.3MB 203ms 0ms nim 1.6.12
nim 1.nim 223ms 0.7ms 9.5MB 210ms 0ms nim/clang 1.6.12

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 2.nim 382ms 0.7ms 1.3MB 370ms 0ms nim 1.6.12
nim 2.nim 410ms 0.4ms 1.3MB 400ms 0ms nim/clang 1.6.12

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 2.nim 41ms 0.7ms 1.3MB 30ms 0ms nim 1.6.12
nim 2.nim 43ms 0.6ms 1.2MB 30ms 0ms nim/clang 1.6.12

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 2.nim 596ms 2.2ms 6.3MB 583ms 0ms nim/clang 1.6.12
nim 2.nim 754ms 137ms 6.0MB 743ms 0ms nim 1.6.12
nim 1.nim 1028ms 28ms 41.0MB 1007ms 10ms nim 1.6.12
nim 1.nim 1034ms 43ms 41.2MB 1020ms 0ms nim/clang 1.6.12

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 1.nim 133ms 0.9ms 11.1MB 120ms 0ms nim 1.6.12
nim 1.nim 134ms 0.6ms 11.3MB 123ms 0ms nim/clang 1.6.12
nim 2.nim 139ms 0.5ms 3.2MB 130ms 0ms nim/clang 1.6.12
nim 2.nim 158ms 0.9ms 3.0MB 150ms 0ms nim 1.6.12

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
acton 1.act 4313ms 37ms 7.9MB 3970ms 700ms actonc 0.14.2
nim 1.nim timeout 0.0ms 5.8MB 4987ms 0ms nim 1.6.12
nim 1.nim timeout 0.0ms 6.1MB 4983ms 0ms nim/clang 1.6.12

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
acton 1.act 1394ms 250ms 6.8MB 1220ms 253ms actonc 0.14.2
nim 1.nim timeout 0.0ms 5.8MB 4987ms 0ms nim 1.6.12
nim 1.nim timeout 0.0ms 6.1MB 4983ms 0ms nim/clang 1.6.12

regex-redux

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 1.nim 2506ms 2.8ms 167.8MB 2450ms 37ms nim/clang 1.6.12
nim 1.nim 2550ms 3.8ms 167.2MB 2493ms 37ms nim 1.6.12

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 1.nim 259ms 3.0ms 17.0MB 243ms 0ms nim/clang 1.6.12
nim 1.nim 263ms 0.4ms 16.8MB 243ms 3ms nim 1.6.12

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 1.nim 4121ms 0.6ms 1.3MB 4110ms 0ms nim/clang 1.6.12
nim 1.nim 4122ms 0.6ms 1.3MB 4110ms 0ms nim 1.6.12

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 1.nim 1032ms 0.1ms 1.3MB 1020ms 0ms nim/clang 1.6.12
nim 1.nim 1032ms 0.1ms 1.4MB 1020ms 0ms nim 1.6.12

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 1.nim 261ms 0.5ms 1.3MB 250ms 0ms nim/clang 1.6.12
nim 1.nim 261ms 1.0ms 1.3MB 250ms 0ms nim 1.6.12