V VS Hack benchmarks

Current benchmark data was generated on Wed Sep 28 2022, 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
v 1.v 1028ms 5.2ms 37.3MB 1007ms 7ms v/clang+gc 0.3.1
v 1.v 1031ms 10ms 37.2MB 1007ms 7ms v/clang 0.3.1
hacklang 1.hack timeout 0.0ms 0.0MB 0ms 0ms hhvm 4.169.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 111ms 2.3ms 5.6MB 100ms 0ms v/clang 0.3.1
v 1.v 111ms 1.1ms 5.6MB 100ms 0ms v/clang+gc 0.3.1
hacklang 1.hack 1619ms 2.3ms 193.4MB 1547ms 37ms hhvm 4.169.0

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
hacklang 1.hack 1958ms 3.9ms 175.2MB 1893ms 33ms hhvm 4.169.0
v 1.v timeout 0.0ms 0.0MB 0ms 0ms v/clang 0.3.1
v 1.v timeout 0.0ms 0.0MB 0ms 0ms v/clang+gc 0.3.1

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
hacklang 1.hack 959ms 9.6ms 175.8MB 893ms 30ms hhvm 4.169.0
v 1-m.v 2053ms 75ms 24.5MB 2157ms 1707ms v/clang+gc 0.3.1
v 1-m.v 2061ms 26ms 20.5MB 2050ms 1797ms v/clang 0.3.1

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v timeout 0.0ms 0.0MB 0ms 0ms v/clang+gc 0.3.1

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v timeout 0.0ms 0.0MB 0ms 0ms v/clang+gc 0.3.1

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 3311ms 7.5ms 1.9MB 3300ms 0ms v/clang+gc 0.3.1
v 1.v 3317ms 5.9ms 1.9MB 3307ms 0ms v/clang 0.3.1

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 277ms 0.4ms 2.0MB 270ms 0ms v/clang+gc 0.3.1
v 1.v 277ms 1.1ms 1.9MB 267ms 0ms v/clang 0.3.1

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 576ms 0.6ms 2.3MB 567ms 0ms v/clang+gc 0.3.1
v 1.v 577ms 1.8ms 2.2MB 563ms 0ms v/clang 0.3.1

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 61ms 0.5ms 2.3MB 50ms 0ms v/clang+gc 0.3.1
v 1.v 61ms 0.7ms 2.2MB 50ms 0ms v/clang 0.3.1

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 2.3ms 1.0ms 2.1MB 0ms 0ms v/clang+gc 0.3.1
v 1.v 2.9ms 2.0ms 2.1MB 0ms 0ms v/clang 0.3.1
hacklang 1.hack 770ms 5.4ms 171.3MB 714ms 26ms hhvm 4.169.0

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 418ms 0.7ms 2.3MB 410ms 0ms v/clang+gc 0.3.1
v 1.v 428ms 1.0ms 2.3MB 417ms 0ms v/clang 0.3.1

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 1248ms 0.8ms 2.2MB 1237ms 0ms v/clang+gc 0.3.1
v 1.v 1276ms 1.8ms 2.3MB 1267ms 0ms v/clang 0.3.1

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 136ms 0.4ms 2.2MB 123ms 0ms v/clang+gc 0.3.1
v 1.v 141ms 0.7ms 2.2MB 130ms 0ms v/clang 0.3.1

mandelbrot

Input: 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 427ms 0.6ms 5.1MB 413ms 0ms v/clang+gc 0.3.1
v 1.v 436ms 3.6ms 8.1MB 420ms 0ms v/clang 0.3.1

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 21ms 0.1ms 2.2MB 10ms 0ms v/clang 0.3.1
v 1.v 23ms 3.8ms 2.2MB 10ms 0ms v/clang+gc 0.3.1

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 1018ms 0.8ms 2.2MB 1010ms 0ms v/clang 0.3.1
v 1.v 1026ms 15ms 2.3MB 1013ms 0ms v/clang+gc 0.3.1

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 105ms 0.1ms 2.4MB 90ms 0ms v/clang 0.3.1
v 1.v 105ms 0.5ms 2.4MB 100ms 0ms v/clang+gc 0.3.1

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 491ms 20ms 41.2MB 473ms 0ms v/clang 0.3.1
v 2.v 494ms 1.3ms 10.5MB 480ms 0ms v/clang+gc 0.3.1
v 2.v 504ms 7.3ms 6.9MB 490ms 0ms v/clang 0.3.1
v 1.v 509ms 24ms 41.2MB 490ms 0ms v/clang+gc 0.3.1

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 2.v 115ms 0.1ms 3.3MB 107ms 0ms v/clang 0.3.1
v 1.v 116ms 4.9ms 19.5MB 103ms 0ms v/clang 0.3.1
v 2.v 116ms 0.8ms 3.3MB 103ms 0ms v/clang+gc 0.3.1
v 1.v 123ms 8.1ms 19.0MB 107ms 0ms v/clang+gc 0.3.1

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 4725ms 90ms 3.3MB 4697ms 10ms v/clang+gc 0.3.1
v 1.v timeout 0.0ms 0.0MB 0ms 0ms v/clang 0.3.1
v 2.v timeout 0.0ms 0.0MB 0ms 0ms v/clang+gc 0.3.1

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 1186ms 19ms 2.5MB 1173ms 0ms v/clang+gc 0.3.1
v 2.v 1471ms 13ms 3.1MB 1453ms 0ms v/clang+gc 0.3.1
v 1.v 1593ms 11ms 3.0MB 1580ms 0ms v/clang 0.3.1

regex-redux

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v timeout 0.0ms 0.0MB 0ms 0ms v/clang+gc 0.3.1

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 3978ms 15ms 26.1MB 3960ms 0ms v/clang+gc 0.3.1

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 4119ms 2.7ms 2.8MB 4107ms 0ms v/clang 0.3.1
v 1.v 4120ms 4.1ms 2.9MB 4107ms 0ms v/clang+gc 0.3.1

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 1032ms 0.1ms 2.6MB 1020ms 0ms v/clang+gc 0.3.1
v 1.v 1032ms 0.5ms 2.6MB 1020ms 0ms v/clang 0.3.1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 260ms 0.3ms 2.6MB 250ms 0ms v/clang 0.3.1
v 1.v 261ms 1.0ms 2.5MB 250ms 0ms v/clang+gc 0.3.1