Codon VS D benchmarks

Current benchmark data was generated on Tue Mar 25 2025, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][4 cores] AMD EPYC 7763 64-Core Processor (Model 1)

* -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

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 1.6ms 0.1ms 3.0MB 0ms 0ms ldc2 1.40.1
d 1.d 2.2ms 0.3ms 5.0MB 0ms 0ms dmd 2.110.0
codon 1-m.py 11ms 0.7ms 8.6MB 20ms 0ms codon 0.18.2

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 362ms 1.8ms 2.9MB 350ms 0ms ldc2 1.40.1
d 2.d 362ms 0.4ms 2.9MB 350ms 0ms ldc2 1.40.1
d 1.d 682ms 4.0ms 4.6MB 673ms 0ms dmd 2.110.0
codon 1.py 1322ms 1.2ms 8.8MB 1630ms 0ms codon 0.18.2
d 2.d 2040ms 13ms 4.6MB 2033ms 0ms dmd 2.110.0

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 2.d 39ms 0.1ms 2.9MB 30ms 0ms ldc2 1.40.1
d 1.d 39ms 0.4ms 2.9MB 30ms 0ms ldc2 1.40.1
d 1.d 71ms 0.3ms 4.6MB 60ms 0ms dmd 2.110.0
codon 1-m.py 176ms 3.4ms 9.0MB 487ms 0ms codon 0.18.2
d 2.d 210ms 3.6ms 4.5MB 203ms 0ms dmd 2.110.0

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 330ms 2.6ms 43.1MB 317ms 3ms ldc2 1.40.1
d 1.d 369ms 6.5ms 77.3MB 353ms 7ms dmd 2.110.0
codon 1-m.py 461ms 8.3ms 47.7MB 763ms 0ms codon 0.18.2
d 2.d 843ms 1.5ms 46.9MB 823ms 0ms ldc2 1.40.1
d 2.d 1168ms 2.1ms 48.7MB 1150ms 10ms dmd 2.110.0
codon 2.py 1572ms 19ms 100.8MB 1877ms 27ms codon 0.18.2

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 64ms 1.5ms 15.0MB 57ms 0ms ldc2 1.40.1
d 1.d 77ms 3.4ms 27.2MB 67ms 0ms dmd 2.110.0
codon 1-m.py 125ms 0.2ms 18.6MB 430ms 0ms codon 0.18.2
d 2.d 209ms 2.5ms 17.1MB 200ms 0ms ldc2 1.40.1
d 2.d 294ms 1.0ms 18.9MB 280ms 0ms dmd 2.110.0
codon 2-m.py 397ms 1.3ms 27.1MB 707ms 3ms codon 0.18.2