JuliaPerf / BenchmarksGame.jl

Other
43 stars 13 forks source link

Mandelbrot fast #29

Closed maltezfaria closed 5 years ago

maltezfaria commented 5 years ago

on my machine this version is slightly faster. Using @benchmark I get

  mean time:        2.634 s (3.20% GC)   --> master version
  mean time:        2.279 s (2.40% GC)   --> pull request version

Change is to check if abs2>4 only every few iterations. This idea was on one of the c++ codes I found on their website.

maltezfaria commented 5 years ago

oh, one possible problem I found was that because we use Float32, the result for the performance benchmark size n=16000 is actually different from a reference result which uses 64bit floats. Not sure if that will be problem. Should the result be "correct" for the performance benchmark size as well? If so the code should use Float64 then.

KristofferC commented 5 years ago

What does the other implementations use?

maltezfaria commented 5 years ago

the julia version I departed from already used Float32. The other versions I glanced at (c and c++ at the top 5) use double

KristofferC commented 5 years ago

We should probably switch to Float64 then.