niklas-heer / speed-comparison

A repo which compares the speed of different programming languages.
https://niklas-heer.github.io/speed-comparison
MIT License
475 stars 76 forks source link

add more `nrounds` #34

Closed Moelf closed 1 year ago

Moelf commented 1 year ago

basically it is observed some interpreter / language JIT has constant overhead, can be bump nrounds to 1000 times larger? or at least have two times, one for nrounds small (like 1000), one for nrounds very large, like 1000000000:

for 1000000000:

% hyperfine 'julia --startup-file=no leibniz.jl'
Benchmark 1: julia --startup-file=no leibniz.jl
  Time (mean ± σ):      4.145 s ±  0.045 s    [User: 4.396 s, System: 0.459 s]
  Range (min … max):    4.068 s …  4.210 s    10 runs

% gcc -O3 -march=native leibniz.c -o c
% hyperfine './c'                               
Benchmark 1: ./c
  Time (mean ± σ):      3.925 s ±  0.046 s    [User: 3.919 s, System: 0.001 s]
  Range (min … max):    3.870 s …  4.002 s    10 runs
Moelf commented 1 year ago

can be fixed by https://github.com/niklas-heer/speed-comparison/pull/35