MRaster examples 21.0.0.0
Image Processing Library
Loading...
Searching...
No Matches
mandelbrot_bm_cplx_hyper.cpp File Reference

Benchmark drawing a mandelbrot set using the C++ complex type and excluding hypocycloids. More...

Go to the source code of this file.

Detailed Description

Benchmark drawing a mandelbrot set using the C++ complex type and excluding hypocycloids.

Author
Mitch Richling https://www.mitchr.me
Standards
C++20
Details

Basic benchmark. Uses complex numbers. Has several algorithmic optimizations.

Depending upon what region is being drawn, the distribution of points satisfying the various optimization conditions will change. Each optimization has a cost in execution, and if that cost is higher than the benefits on the region then it should be avoided – this is especially true with CYCORLIM. For this reason the set of boolean variables determining what optimizations to use should be tuned for the region. In addition, CYCORLIM cost is dominated by LASTMAX. For large, zoomed out images this optimization breaks even at about LASTMAX=4. For zoomed in images with a significant space covered by a period N bulb, setting LASTMAX to something larger than N can provide a significant speedup.

     | doBOUND | doPERIOD1 | doPERIOD2 | doREFLCT | doCYCORLIM | LASTMAX | Speed Up |
     |---------+-----------+-----------+----------+------------+---------+----------|
     | true    | -         | -         | -        | -          | -       | N/A      |
     | true    | true      | -         | -        | -          | -       | 3.0x     |
     | true    | true      | true      | -        | -          | -       | 4.6x     |
     | true    | true      | true      | true     | -          | -       | 5.6x     |
     | true    | true      | true      | true     | true       | 4       | 5.8x     |

Note doREFLCT should be implemented differently for cases where symmetry is known in advance. In these cases we can simply avoid iterating over the symmetric points at all instead of testing to see if we are on a symmetric point.

Definition in file mandelbrot_bm_cplx_hyper.cpp.