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

helloworld

Input: QwQ

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.c 1.5ms 0.2ms 0.6MB 0ms 0ms zigcc 0.10.0-dev.2820+48fd92365
1.c 2.5ms 0.4ms 1.0MB 0ms 0ms gcc 12.1.0
1.c 4.0ms 1.8ms 2.2MB 0ms 0ms clang 11.0.0

knucleotide

Input: 2500000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.c 284ms 3.5ms 23.6MB 470ms 20ms gcc 12.1.0
1.c 733ms 95ms 20.2MB 1007ms 30ms clang 11.0.0

Input: 250000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.c 43ms 2.2ms 12.8MB 53ms 0ms gcc 12.1.0
1.c 87ms 14ms 9.6MB 123ms 3ms clang 11.0.0

nbody

Input: 5000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
8-i.c 392ms 2.6ms 1.0MB 373ms 0ms clang 11.0.0
5.c 407ms 2.7ms 1.0MB 393ms 0ms gcc 12.1.0
8-i.c 409ms 2.7ms 1.0MB 393ms 0ms gcc 12.1.0
8-i.c 411ms 0.9ms 0.6MB 400ms 0ms zigcc 0.10.0-dev.2820+48fd92365
5.c 439ms 4.8ms 1.1MB 423ms 0ms clang 11.0.0
5.c 517ms 1.4ms 0.6MB 507ms 0ms zigcc 0.10.0-dev.2820+48fd92365
2.c 553ms 1.9ms 1.6MB 533ms 0ms zigcc 0.10.0-dev.2820+48fd92365
2.c 568ms 5.2ms 1.1MB 550ms 0ms clang 11.0.0
2.c 580ms 4.0ms 1.0MB 573ms 0ms gcc 12.1.0

Input: 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
8-i.c 44ms 0.1ms 0.6MB 33ms 0ms zigcc 0.10.0-dev.2820+48fd92365
8-i.c 44ms 0.8ms 1.0MB 33ms 0ms gcc 12.1.0
5.c 45ms 1.4ms 1.0MB 30ms 0ms gcc 12.1.0
8-i.c 46ms 2.2ms 1.1MB 30ms 0ms clang 11.0.0
5.c 52ms 7.8ms 1.1MB 40ms 0ms clang 11.0.0
5.c 56ms 0.4ms 0.6MB 47ms 0ms zigcc 0.10.0-dev.2820+48fd92365
2.c 58ms 1.0ms 0.6MB 50ms 0ms zigcc 0.10.0-dev.2820+48fd92365
2.c 63ms 3.1ms 1.1MB 50ms 0ms clang 11.0.0
2.c 63ms 0.8ms 0.9MB 50ms 0ms gcc 12.1.0

nsieve

Input: 12

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.c 1151ms 25ms 40.7MB 1103ms 33ms clang 11.0.0
1.c 1277ms 29ms 41.1MB 1240ms 20ms gcc 12.1.0
1.c 1339ms 54ms 40.2MB 1307ms 13ms zigcc 0.10.0-dev.2820+48fd92365

Input: 10

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.c 145ms 2.8ms 11.7MB 133ms 0ms clang 11.0.0
1.c 146ms 3.8ms 10.9MB 133ms 0ms zigcc 0.10.0-dev.2820+48fd92365
1.c 152ms 5.7ms 11.8MB 133ms 0ms gcc 12.1.0

spectral-norm

Input: 8000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4-m.c 1580ms 9.1ms 1.1MB 3057ms 3ms gcc 12.1.0
6-im.c 1790ms 16ms 3.0MB 3493ms 3ms clang 11.0.0
6-im.c 1826ms 34ms 0.9MB 3530ms 3ms gcc 12.1.0
4-m.c 1939ms 26ms 2.9MB 3753ms 10ms clang 11.0.0
5-im.c 2009ms 22ms 1.0MB 3867ms 3ms gcc 12.1.0
5-im.c 2164ms 23ms 3.0MB 4220ms 10ms clang 11.0.0
3-m.c 2358ms 27ms 1.0MB 4570ms 10ms gcc 12.1.0
3-m.c 2382ms 21ms 3.1MB 4617ms 17ms clang 11.0.0

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4-m.c 411ms 5.6ms 1.0MB 777ms 0ms gcc 12.1.0
6-im.c 462ms 5.7ms 3.0MB 873ms 0ms clang 11.0.0
6-im.c 477ms 17ms 1.0MB 880ms 0ms gcc 12.1.0
4-m.c 496ms 13ms 3.1MB 943ms 0ms clang 11.0.0
5-im.c 511ms 3.2ms 1.0MB 970ms 0ms gcc 12.1.0
5-im.c 560ms 6.1ms 3.0MB 1063ms 3ms clang 11.0.0
3-m.c 601ms 7.9ms 1.0MB 1150ms 0ms gcc 12.1.0
3-m.c 602ms 19ms 3.0MB 1150ms 3ms clang 11.0.0

Input: 2000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4-m.c 114ms 3.4ms 1.0MB 190ms 0ms gcc 12.1.0
6-im.c 132ms 5.2ms 3.1MB 223ms 0ms clang 11.0.0
4-m.c 132ms 1.7ms 3.1MB 233ms 0ms clang 11.0.0
6-im.c 134ms 12ms 1.0MB 230ms 0ms gcc 12.1.0
5-im.c 142ms 5.9ms 1.0MB 250ms 0ms gcc 12.1.0
5-im.c 152ms 2.9ms 3.0MB 263ms 0ms clang 11.0.0
3-m.c 163ms 7.5ms 3.1MB 290ms 0ms clang 11.0.0
3-m.c 164ms 3.7ms 0.9MB 293ms 0ms gcc 12.1.0