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

helloworld

Input: QwQ

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.c 1.6ms 0.6ms 1.0MB 0ms 0ms zigcc 0.11.0-dev.2227+f9b582950
1.c 2.2ms 0.5ms 1.3MB 0ms 0ms gcc 12.2.0
1.c 3.7ms 0.3ms 0.0MB 0ms 0ms clang 14.0.0

knucleotide

Input: 2500000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.c 249ms 0.7ms 23.5MB 413ms 10ms gcc 12.2.0
1-m.c 496ms 10ms 20.4MB 847ms 20ms clang 14.0.0

Input: 250000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.c 35ms 1.0ms 12.8MB 43ms 0ms gcc 12.2.0
1.c 63ms 1.5ms 9.7MB 90ms 3ms clang 14.0.0

nbody

Input: 5000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
8-i.c 312ms 2.0ms 1.3MB 300ms 0ms zigcc 0.11.0-dev.2227+f9b582950
5.c 322ms 1.0ms 1.3MB 310ms 0ms gcc 12.2.0
5.c 329ms 0.5ms 1.4MB 317ms 0ms clang 14.0.0
5.c 330ms 1.2ms 1.0MB 320ms 0ms zigcc 0.11.0-dev.2227+f9b582950
2.c 339ms 0.4ms 1.2MB 330ms 0ms zigcc 0.11.0-dev.2227+f9b582950
2.c 341ms 0.6ms 1.4MB 330ms 0ms clang 14.0.0
8-i.c 365ms 3.7ms 1.4MB 353ms 0ms clang 14.0.0
8-i.c 365ms 0.7ms 1.3MB 357ms 0ms gcc 12.2.0
2.c 624ms 0.5ms 1.3MB 613ms 0ms gcc 12.2.0

Input: 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
5.c 34ms 0.3ms 1.3MB 27ms 0ms gcc 12.2.0
8-i.c 35ms 2.4ms 1.3MB 27ms 0ms zigcc 0.11.0-dev.2227+f9b582950
5.c 35ms 0.5ms 1.0MB 27ms 0ms zigcc 0.11.0-dev.2227+f9b582950
2.c 36ms 0.2ms 1.2MB 27ms 0ms zigcc 0.11.0-dev.2227+f9b582950
5.c 37ms 2.4ms 1.4MB 30ms 0ms clang 14.0.0
8-i.c 39ms 0.2ms 1.3MB 30ms 0ms gcc 12.2.0
2.c 39ms 1.8ms 1.4MB 27ms 0ms clang 14.0.0
8-i.c 39ms 0.2ms 1.4MB 30ms 0ms clang 14.0.0
2.c 68ms 4.0ms 1.3MB 60ms 0ms gcc 12.2.0

nsieve

Input: 12

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.c 922ms 32ms 40.8MB 897ms 10ms clang 14.0.0
1.c 950ms 68ms 40.1MB 927ms 7ms zigcc 0.11.0-dev.2227+f9b582950
1.c 985ms 51ms 41.0MB 960ms 7ms gcc 12.2.0

Input: 10

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.c 122ms 1.6ms 11.7MB 110ms 0ms clang 14.0.0
1.c 123ms 3.3ms 11.0MB 107ms 0ms zigcc 0.11.0-dev.2227+f9b582950
1.c 125ms 0.7ms 11.7MB 113ms 0ms gcc 12.2.0

spectral-norm

Input: 8000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4-m.c 1404ms 3.0ms 1.3MB 2747ms 0ms gcc 12.2.0
6-im.c 1622ms 5.6ms 1.3MB 3177ms 3ms gcc 12.2.0
6-im.c 1684ms 3.0ms 3.3MB 3303ms 0ms clang 14.0.0
4-m.c 1727ms 17ms 3.3MB 3377ms 3ms clang 14.0.0
5-im.c 1869ms 15ms 1.3MB 3657ms 0ms gcc 12.2.0
5-im.c 2176ms 1.8ms 3.3MB 4277ms 0ms clang 14.0.0
3-m.c 2227ms 15ms 3.7MB 4373ms 0ms clang 14.0.0
3-m.c 2227ms 15ms 1.3MB 4377ms 0ms gcc 12.2.0

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4-m.c 369ms 16ms 1.3MB 690ms 0ms gcc 12.2.0
6-im.c 416ms 2.7ms 1.3MB 800ms 0ms gcc 12.2.0
6-im.c 431ms 1.5ms 3.2MB 827ms 0ms clang 14.0.0
4-m.c 439ms 5.7ms 3.1MB 830ms 3ms clang 14.0.0
5-im.c 473ms 0.9ms 1.3MB 910ms 0ms gcc 12.2.0
5-im.c 562ms 12ms 3.2MB 1077ms 0ms clang 14.0.0
3-m.c 564ms 1.6ms 3.3MB 1090ms 0ms clang 14.0.0
3-m.c 565ms 1.5ms 1.3MB 1093ms 0ms gcc 12.2.0

Input: 2000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4-m.c 97ms 0.5ms 1.3MB 173ms 0ms gcc 12.2.0
6-im.c 113ms 1.0ms 1.3MB 200ms 0ms gcc 12.2.0
6-im.c 117ms 1.7ms 3.2MB 207ms 0ms clang 14.0.0
4-m.c 117ms 0.9ms 3.1MB 210ms 0ms clang 14.0.0
5-im.c 128ms 2.0ms 1.3MB 227ms 0ms gcc 12.2.0
5-im.c 147ms 0.8ms 3.3MB 270ms 0ms clang 14.0.0
3-m.c 150ms 1.7ms 1.3MB 277ms 0ms gcc 12.2.0
3-m.c 161ms 16ms 3.2MB 290ms 0ms clang 14.0.0