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

fannkuch-redux

Input: 11

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-im.cpp 764ms 21ms 1.3MB 1460ms 0ms g++ 12.2.0
1-im.cpp 769ms 9.2ms 4.1MB 1497ms 0ms clang++ 14.0.0

Input: 10

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-im.cpp 71ms 0.7ms 1.4MB 120ms 0ms g++ 12.2.0
1-im.cpp 75ms 1.4ms 4.0MB 123ms 0ms clang++ 14.0.0

helloworld

Input: QwQ

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.cpp 1.8ms 0.5ms 1.4MB 0ms 0ms clang++ 14.0.0
1.cpp 2.0ms 0.5ms 1.3MB 0ms 0ms g++ 12.2.0

nbody

Input: 5000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
0-i.cpp 225ms 0.8ms 1.3MB 213ms 0ms g++ 12.2.0
0-i.cpp 253ms 0.2ms 1.5MB 243ms 0ms clang++ 14.0.0
1.cpp 326ms 1.2ms 1.5MB 313ms 0ms clang++ 14.0.0
1.cpp 342ms 1.0ms 1.3MB 330ms 0ms g++ 12.2.0

Input: 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
0-i.cpp 25ms 0.2ms 1.3MB 20ms 0ms g++ 12.2.0
0-i.cpp 28ms 0.2ms 1.4MB 20ms 0ms clang++ 14.0.0
1.cpp 35ms 0.4ms 1.4MB 23ms 0ms clang++ 14.0.0
1.cpp 38ms 0.8ms 1.4MB 30ms 0ms g++ 12.2.0

nsieve

Input: 12

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.cpp 650ms 3.0ms 7.8MB 637ms 0ms g++ 12.2.0
1.cpp 722ms 2.3ms 7.4MB 707ms 0ms clang++ 14.0.0

Input: 10

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.cpp 154ms 0.6ms 4.0MB 143ms 0ms g++ 12.2.0
1.cpp 170ms 0.3ms 4.0MB 160ms 0ms clang++ 14.0.0

spectral-norm

Input: 8000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
7-m.cpp 1069ms 4.4ms 3.4MB 2087ms 0ms clang++ 14.0.0
8-m.cpp 1070ms 1.0ms 1.3MB 2093ms 0ms g++ 12.2.0
8-m.cpp 1072ms 14ms 3.3MB 2083ms 0ms clang++ 14.0.0
7-m.cpp 1079ms 17ms 1.3MB 2100ms 0ms g++ 12.2.0
6-im.cpp 2228ms 12ms 3.3MB 4367ms 3ms clang++ 14.0.0
6-im.cpp 2236ms 6.4ms 1.3MB 4400ms 0ms g++ 12.2.0

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
8-m.cpp 277ms 1.4ms 3.4MB 517ms 0ms clang++ 14.0.0
7-m.cpp 277ms 2.8ms 1.3MB 523ms 0ms g++ 12.2.0
7-m.cpp 278ms 1.1ms 3.4MB 520ms 0ms clang++ 14.0.0
8-m.cpp 279ms 2.3ms 1.3MB 527ms 0ms g++ 12.2.0
6-im.cpp 567ms 0.6ms 3.3MB 1090ms 0ms clang++ 14.0.0
6-im.cpp 573ms 9.8ms 1.3MB 1103ms 0ms g++ 12.2.0

Input: 2000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
8-m.cpp 76ms 1.5ms 3.3MB 130ms 0ms clang++ 14.0.0
7-m.cpp 76ms 0.2ms 3.4MB 130ms 0ms clang++ 14.0.0
8-m.cpp 76ms 0.8ms 1.3MB 130ms 0ms g++ 12.2.0
7-m.cpp 77ms 1.4ms 1.3MB 130ms 0ms g++ 12.2.0
6-im.cpp 151ms 0.8ms 1.3MB 280ms 0ms g++ 12.2.0
6-im.cpp 152ms 2.9ms 3.3MB 273ms 0ms clang++ 14.0.0