JuliaLang / Microbenchmarks

Microbenchmarks comparing the Julia Programming language with other languages
https://julialang.org/benchmarks/
Other
87 stars 48 forks source link

Fortran compiler "cheating" at Fibonacci benchmark #58

Open MilesCranmer opened 2 years ago

MilesCranmer commented 2 years ago

FYI the fortran compiler is "cheating" at two benchmarks: fibonacci and mandelbrot. See the latest benchmark results: https://github.com/JuliaLang/Microbenchmarks/runs/5503666442?check_suite_focus=true#step:17:25.

For Fibonacci, C gives a time of 0.021 whereas fortran gives a time of 0.000037.

For Mandelbrot, C gives a time of 0.068 whereas fortran gives a time of 0.000066.

I assume the latest fortran compiler has translated these benchmarks to analytic versions.

acxz commented 2 years ago

For fib this repo may have some solutions for us: https://github.com/drujensen/fib

KristofferC commented 2 years ago

It's usually good to feed inputs from a file or stdin to prevent specialising on benchmark constants.