Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak mandelbrot-fast.jl for performance. #46

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

non-Jedi
Copy link
Contributor

@non-Jedi non-Jedi commented Dec 19, 2019

Multiple versions with different threadings included because different versions are faster depending on the machine. Depending on machine, gains can be over 20% compared to original mandelbrot-fast.jl.

I would appreciate input on relative timings for each of the scripts others see on their computer. For example, I get the following timings on two of my machines using hyperfine:

laptop with Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz desktop with Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz desktop with Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
mandelbrot-fast.jl (original) 2.492 1.864 1.788
mandelbrot-fast.jl 2.426 1.494 1.401
mandelbrot-fast.v2.jl 2.391 1.802 1.718
mandelbrot-fast.v3.jl 2.377 1.543 1.448
Best mandelbrot-fast.v3.jl mandelbrot-fast.jl mandelbrot-fast.jl

NOTE: running mandelbrot-fast.v3.jl requires installation of https://github.com/mohamed82008/KissThreading.jl

Changes included in every version:

  • Removing threading from filling xvals and yvals--threading overhead is too high for such a simple operation.
  • Remove @simd annotation from mandel_inner--simd is occurring at the level of mand8; @simd doesn't hurt runtime but increases compilation time.
  • Only run mandelbrot when !isinteractive() to make development and debugging easier.
  • Various tweaks and minor stylistic updates for succinctness and maybe a marginal increase in performance.

@non-Jedi
Copy link
Contributor Author

@non-Jedi non-Jedi force-pushed the mandelbrot-tweaking branch from 442031e to d1be6d4 Compare December 20, 2019 15:46
Multiple versions with different threadings included because different
versions are faster depending on the machine. Depending on machine,
gains can be over 20% compared to original mandelbrot-fast.jl.

NOTE: running mandelbrot-fast.v3.jl requires installation of
https://github.com/mohamed82008/KissThreading.jl

Changes included in every version:
- Removing threading from filling xvals and yvals--threading overhead
  is too high for such a simple operation.
- Remove @simd annotation from mandel_inner--simd is occurring at the
  level of mand8; @simd doesn't hurt runtime but increases compilation
  time.
- Only run mandelbrot when !isinteractive() to make development and
  debugging easier.
- Various tweaks and minor stylistic updates for succinctness and
  maybe a marginal increase in performance.
Different results obtained for higher n with Float32 than other
implementations, so it's not allowed.
@non-Jedi non-Jedi force-pushed the mandelbrot-tweaking branch from d078879 to 204f6e3 Compare December 20, 2019 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant