Php VS Crystal benchmarks

Current benchmark data was generated on Sun Jan 29 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.)

binarytrees

Input: 18

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 1.cr 1798ms 15ms 64.1MB 1773ms 10ms crystal 1.7.2
php 1.php timeout 0.0ms 141.0MB 4947ms 33ms php 8.2.1

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 1.cr 142ms 4.4ms 10.9MB 127ms 0ms crystal 1.7.2
php 1.php 787ms 4.5ms 62.3MB 757ms 10ms php 8.2.1

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 1.cr 2.2ms 0.7ms 2.9MB 0ms 0ms crystal 1.7.2
php 1.php 47ms 1.6ms 50.8MB 22ms 12ms php 8.2.1

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 1.cr 1288ms 25ms 64.1MB 1253ms 20ms crystal 1.7.2
php 1.php 4872ms 54ms 113.2MB 4823ms 30ms php 8.2.1

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 1.cr 221ms 5.3ms 22.4MB 207ms 0ms crystal 1.7.2
php 1.php 1068ms 6.3ms 66.3MB 1037ms 17ms php 8.2.1