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

helloworld

Input: QwQ

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.c 1.8ms 0.7ms 1.3MB 0ms 0ms gcc 12.2.0
1.c 2.1ms 0.7ms 0.9MB 0ms 0ms zigcc 0.11.0-dev.632+d69e97ae1
1.c 3.4ms 0.5ms 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 238ms 9.4ms 23.6MB 387ms 10ms gcc 12.2.0
1-m.c 496ms 13ms 20.6MB 850ms 17ms clang 14.0.0

Input: 250000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.c 32ms 1.0ms 13.4MB 37ms 3ms gcc 12.2.0
1-m.c 61ms 2.5ms 9.7MB 97ms 0ms clang 14.0.0

nbody

Input: 5000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
8-i.c 269ms 0.9ms 0.9MB 257ms 0ms zigcc 0.11.0-dev.632+d69e97ae1
8-i.c 329ms 0.5ms 1.3MB 320ms 0ms gcc 12.2.0
5.c 334ms 0.9ms 1.3MB 320ms 0ms gcc 12.2.0
5.c 354ms 0.8ms 1.4MB 343ms 0ms clang 14.0.0
5.c 354ms 1.6ms 1.0MB 340ms 0ms zigcc 0.11.0-dev.632+d69e97ae1
2.c 362ms 0.6ms 1.0MB 350ms 0ms zigcc 0.11.0-dev.632+d69e97ae1
8-i.c 370ms 19ms 1.4MB 360ms 0ms clang 14.0.0
2.c 379ms 8.8ms 1.4MB 367ms 0ms clang 14.0.0
2.c 480ms 1.0ms 1.3MB 470ms 0ms gcc 12.2.0

Input: 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
8-i.c 30ms 1.5ms 1.0MB 20ms 0ms zigcc 0.11.0-dev.632+d69e97ae1
5.c 34ms 0.1ms 1.3MB 30ms 0ms gcc 12.2.0
8-i.c 36ms 0.4ms 1.3MB 27ms 0ms gcc 12.2.0
5.c 37ms 0.1ms 1.0MB 30ms 0ms zigcc 0.11.0-dev.632+d69e97ae1
8-i.c 37ms 1.1ms 1.4MB 30ms 0ms clang 14.0.0
5.c 38ms 0.6ms 1.4MB 30ms 0ms clang 14.0.0
2.c 38ms 0.1ms 1.0MB 27ms 0ms zigcc 0.11.0-dev.632+d69e97ae1
2.c 45ms 3.8ms 1.4MB 30ms 0ms clang 14.0.0
2.c 53ms 2.2ms 1.3MB 40ms 0ms gcc 12.2.0

nsieve

Input: 12

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.c 817ms 11ms 41.0MB 790ms 17ms gcc 12.2.0
1.c 821ms 3.0ms 40.3MB 797ms 10ms zigcc 0.11.0-dev.632+d69e97ae1
1.c 840ms 31ms 40.8MB 803ms 20ms clang 14.0.0

Input: 10

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.c 111ms 1.8ms 11.6MB 97ms 0ms clang 14.0.0
1.c 119ms 0.8ms 11.6MB 103ms 0ms gcc 12.2.0
1.c 122ms 2.7ms 10.9MB 110ms 0ms zigcc 0.11.0-dev.632+d69e97ae1

spectral-norm

Input: 8000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4-m.c 1268ms 3.4ms 1.3MB 2480ms 0ms gcc 12.2.0
6-im.c 1515ms 0.5ms 1.3MB 2970ms 0ms gcc 12.2.0
6-im.c 1561ms 3.6ms 3.2MB 3063ms 0ms clang 14.0.0
5-im.c 1586ms 15ms 1.3MB 3100ms 0ms gcc 12.2.0
4-m.c 1612ms 21ms 3.1MB 3127ms 0ms clang 14.0.0
3-m.c 1864ms 15ms 3.5MB 3667ms 0ms clang 14.0.0
3-m.c 1875ms 14ms 1.3MB 3663ms 0ms gcc 12.2.0
5-im.c 1940ms 9.8ms 3.5MB 3810ms 3ms clang 14.0.0

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4-m.c 331ms 7.9ms 1.3MB 623ms 0ms gcc 12.2.0
6-im.c 390ms 3.0ms 1.3MB 740ms 3ms gcc 12.2.0
6-im.c 400ms 2.8ms 3.3MB 763ms 0ms clang 14.0.0
4-m.c 404ms 0.6ms 3.2MB 770ms 3ms clang 14.0.0
5-im.c 409ms 5.1ms 1.3MB 777ms 0ms gcc 12.2.0
3-m.c 477ms 1.6ms 1.3MB 920ms 0ms gcc 12.2.0
3-m.c 481ms 0.9ms 3.2MB 920ms 0ms clang 14.0.0
5-im.c 497ms 2.0ms 3.1MB 953ms 0ms clang 14.0.0

Input: 2000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4-m.c 89ms 1.1ms 1.3MB 160ms 0ms gcc 12.2.0
6-im.c 106ms 1.2ms 1.3MB 187ms 0ms gcc 12.2.0
6-im.c 107ms 0.3ms 3.2MB 190ms 0ms clang 14.0.0
4-m.c 110ms 1.3ms 3.5MB 197ms 0ms clang 14.0.0
5-im.c 111ms 0.7ms 1.3MB 200ms 0ms gcc 12.2.0
3-m.c 129ms 1.9ms 1.3MB 237ms 0ms gcc 12.2.0
5-im.c 134ms 0.8ms 3.2MB 240ms 0ms clang 14.0.0
3-m.c 138ms 16ms 3.3MB 237ms 0ms clang 14.0.0