V VS C benchmarks

Current benchmark data was generated on Thu Sep 22 2022, 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
v 1.v 1105ms 2.5ms 37.1MB 1087ms 3ms v/clang+gc 0.3.1
v 1.v 1112ms 10ms 37.1MB 1093ms 3ms v/clang 0.3.1

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 111ms 0.4ms 5.6MB 100ms 0ms v/clang 0.3.1
v 1.v 112ms 1.4ms 5.6MB 100ms 0ms v/clang+gc 0.3.1

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v timeout 0.0ms 0.0MB 0ms 0ms v/clang 0.3.1
v 1.v timeout 0.0ms 0.0MB 0ms 0ms v/clang+gc 0.3.1

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1-m.v 2028ms 63ms 20.5MB 2067ms 1743ms v/clang 0.3.1
v 1-m.v 2721ms 1211ms 20.5MB 2717ms 2377ms v/clang+gc 0.3.1

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v timeout 0.0ms 0.0MB 0ms 0ms v/clang+gc 0.3.1

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v timeout 0.0ms 0.0MB 0ms 0ms v/clang+gc 0.3.1

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 3314ms 2.4ms 1.9MB 3300ms 0ms v/clang 0.3.1
v 1.v 3315ms 14ms 2.0MB 3303ms 0ms v/clang+gc 0.3.1

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 277ms 1.3ms 1.9MB 267ms 0ms v/clang 0.3.1
v 1.v 277ms 0.8ms 2.0MB 267ms 0ms v/clang+gc 0.3.1

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 576ms 0.4ms 2.3MB 563ms 0ms v/clang+gc 0.3.1
v 1.v 577ms 0.2ms 2.3MB 560ms 0ms v/clang 0.3.1

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 62ms 1.7ms 2.2MB 50ms 0ms v/clang 0.3.1
v 1.v 62ms 0.5ms 2.2MB 50ms 0ms v/clang+gc 0.3.1

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 1.7ms 0.4ms 2.1MB 0ms 0ms v/clang 0.3.1
v 1.v 1.9ms 0.8ms 1.9MB 0ms 0ms v/clang+gc 0.3.1
c 1.c 2.1ms 0.3ms 1.0MB 0ms 0ms gcc 12.2.0
c 1.c 3.1ms 1.7ms 0.6MB 0ms 0ms zigcc 0.10.0-dev.4060+61aaef0b0
c 1.c 3.1ms 1.3ms 1.1MB 0ms 0ms clang 11.0.0

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 418ms 0.7ms 2.3MB 407ms 0ms v/clang+gc 0.3.1
v 1.v 428ms 0.8ms 2.3MB 420ms 0ms v/clang 0.3.1

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 1248ms 2.5ms 2.3MB 1233ms 0ms v/clang+gc 0.3.1
v 1.v 1280ms 1.9ms 2.3MB 1267ms 0ms v/clang 0.3.1

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 135ms 0.5ms 2.3MB 127ms 0ms v/clang+gc 0.3.1
v 1.v 140ms 0.5ms 2.2MB 130ms 0ms v/clang 0.3.1

mandelbrot

Input: 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 428ms 0.9ms 5.1MB 420ms 0ms v/clang+gc 0.3.1
v 1.v 436ms 0.5ms 8.0MB 423ms 0ms v/clang 0.3.1

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 21ms 0.5ms 2.3MB 10ms 0ms v/clang+gc 0.3.1
v 1.v 21ms 0.1ms 2.2MB 10ms 0ms v/clang 0.3.1

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
c 8-i.c 308ms 0.1ms 0.5MB 300ms 0ms zigcc 0.10.0-dev.4060+61aaef0b0
c 5.c 321ms 0.7ms 1.0MB 310ms 0ms gcc 12.2.0
c 5.c 329ms 0.5ms 0.6MB 320ms 0ms zigcc 0.10.0-dev.4060+61aaef0b0
c 2.c 338ms 0.3ms 0.6MB 330ms 0ms zigcc 0.10.0-dev.4060+61aaef0b0
c 8-i.c 346ms 3.0ms 1.1MB 333ms 0ms clang 11.0.0
c 5.c 367ms 0.2ms 1.1MB 357ms 0ms clang 11.0.0
c 8-i.c 367ms 3.6ms 1.0MB 353ms 0ms gcc 12.2.0
c 2.c 415ms 7.0ms 1.0MB 397ms 0ms clang 11.0.0
c 2.c 624ms 0.5ms 1.0MB 610ms 0ms gcc 12.2.0
v 1.v 1016ms 2.0ms 2.4MB 1000ms 0ms v/clang+gc 0.3.1
v 1.v 1018ms 1.0ms 2.3MB 1010ms 0ms v/clang 0.3.1

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
c 8-i.c 33ms 0.4ms 0.6MB 27ms 0ms zigcc 0.10.0-dev.4060+61aaef0b0
c 5.c 35ms 1.3ms 1.0MB 23ms 0ms gcc 12.2.0
c 5.c 36ms 0.3ms 0.6MB 27ms 0ms zigcc 0.10.0-dev.4060+61aaef0b0
c 2.c 36ms 0.1ms 0.6MB 30ms 0ms zigcc 0.10.0-dev.4060+61aaef0b0
c 8-i.c 39ms 0.4ms 1.0MB 30ms 0ms gcc 12.2.0
c 5.c 40ms 0.6ms 1.1MB 30ms 0ms clang 11.0.0
c 8-i.c 41ms 3.3ms 1.1MB 30ms 0ms clang 11.0.0
c 2.c 43ms 0.2ms 1.1MB 33ms 0ms clang 11.0.0
c 2.c 65ms 0.8ms 1.0MB 53ms 0ms gcc 12.2.0
v 1.v 105ms 0.8ms 2.3MB 97ms 0ms v/clang+gc 0.3.1
v 1.v 108ms 3.2ms 2.4MB 97ms 0ms v/clang 0.3.1

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 2.v 498ms 1.9ms 7.0MB 487ms 0ms v/clang+gc 0.3.1
v 2.v 502ms 2.9ms 10.5MB 483ms 0ms v/clang 0.3.1
v 1.v 696ms 11ms 41.3MB 677ms 3ms v/clang 0.3.1
v 1.v 721ms 25ms 41.2MB 700ms 3ms v/clang+gc 0.3.1
c 1.c 796ms 36ms 40.1MB 757ms 17ms zigcc 0.10.0-dev.4060+61aaef0b0
c 1.c 812ms 22ms 41.0MB 780ms 10ms gcc 12.2.0
c 1.c 820ms 13ms 40.9MB 773ms 27ms clang 11.0.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 2.v 116ms 0.7ms 3.3MB 110ms 0ms v/clang+gc 0.3.1
v 1.v 118ms 1.1ms 19.3MB 100ms 0ms v/clang+gc 0.3.1
v 2.v 119ms 2.1ms 3.3MB 103ms 0ms v/clang 0.3.1
v 1.v 119ms 0.5ms 19.5MB 100ms 0ms v/clang 0.3.1
c 1.c 121ms 0.8ms 10.8MB 103ms 7ms zigcc 0.10.0-dev.4060+61aaef0b0
c 1.c 123ms 1.8ms 11.6MB 110ms 0ms clang 11.0.0
c 1.c 124ms 3.2ms 11.9MB 107ms 0ms gcc 12.2.0

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 4690ms 44ms 3.3MB 4670ms 10ms v/clang+gc 0.3.1
v 1.v timeout 0.0ms 0.0MB 0ms 0ms v/clang 0.3.1
v 2.v timeout 0.0ms 0.0MB 0ms 0ms v/clang+gc 0.3.1

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 1172ms 2.0ms 2.5MB 1153ms 0ms v/clang+gc 0.3.1
v 2.v 1482ms 14ms 3.1MB 1470ms 0ms v/clang+gc 0.3.1
v 1.v 1592ms 28ms 3.0MB 1577ms 3ms v/clang 0.3.1

regex-redux

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v timeout 0.0ms 0.0MB 0ms 0ms v/clang+gc 0.3.1

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 4000ms 28ms 26.1MB 3980ms 0ms v/clang+gc 0.3.1

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
c 4-m.c 1397ms 12ms 1.0MB 2733ms 0ms gcc 12.2.0
c 6-im.c 1588ms 6.1ms 1.0MB 3110ms 0ms gcc 12.2.0
c 6-im.c 1722ms 4.5ms 3.0MB 3380ms 0ms clang 11.0.0
c 4-m.c 1749ms 11ms 2.9MB 3420ms 7ms clang 11.0.0
c 5-im.c 1847ms 1.6ms 1.0MB 3633ms 0ms gcc 12.2.0
c 5-im.c 2034ms 11ms 3.1MB 3990ms 0ms clang 11.0.0
c 3-m.c 2218ms 21ms 1.0MB 4350ms 0ms gcc 12.2.0
c 3-m.c 2222ms 12ms 3.2MB 4360ms 0ms clang 11.0.0
v 1.v 4121ms 1.0ms 2.8MB 4110ms 0ms v/clang 0.3.1
v 1.v 4122ms 2.2ms 2.9MB 4110ms 0ms v/clang+gc 0.3.1

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
c 4-m.c 358ms 1.4ms 1.0MB 690ms 0ms gcc 12.2.0
c 6-im.c 406ms 1.9ms 1.0MB 780ms 0ms gcc 12.2.0
c 6-im.c 443ms 5.0ms 3.0MB 843ms 0ms clang 11.0.0
c 4-m.c 445ms 2.0ms 3.0MB 853ms 0ms clang 11.0.0
c 5-im.c 473ms 2.7ms 1.0MB 910ms 0ms gcc 12.2.0
c 5-im.c 522ms 9.3ms 3.1MB 1003ms 0ms clang 11.0.0
c 3-m.c 559ms 0.8ms 1.0MB 1087ms 0ms gcc 12.2.0
c 3-m.c 576ms 18ms 3.2MB 1100ms 0ms clang 11.0.0
v 1.v 1033ms 0.4ms 2.6MB 1020ms 0ms v/clang 0.3.1
v 1.v 1033ms 1.1ms 2.6MB 1020ms 0ms v/clang+gc 0.3.1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
c 4-m.c 97ms 0.9ms 1.0MB 170ms 0ms gcc 12.2.0
c 6-im.c 110ms 0.9ms 0.9MB 200ms 0ms gcc 12.2.0
c 6-im.c 118ms 0.6ms 3.1MB 210ms 0ms clang 11.0.0
c 4-m.c 121ms 3.1ms 3.1MB 213ms 0ms clang 11.0.0
c 5-im.c 128ms 2.7ms 1.0MB 233ms 0ms gcc 12.2.0
c 5-im.c 139ms 2.4ms 3.1MB 250ms 0ms clang 11.0.0
c 3-m.c 149ms 0.8ms 1.0MB 277ms 0ms gcc 12.2.0
c 3-m.c 153ms 2.3ms 3.2MB 273ms 0ms clang 11.0.0
v 1.v 261ms 0.4ms 2.6MB 250ms 0ms v/clang 0.3.1
v 1.v 261ms 0.4ms 2.6MB 250ms 0ms v/clang+gc 0.3.1