MRaster examples 21.0.0.0
Image Processing Library
|
Benchmark drawing a mandelbrot set using the C++ complex type and excluding hypocycloids. More...
Go to the source code of this file.
Benchmark drawing a mandelbrot set using the C++ complex type and excluding hypocycloids.
Copyright (c) 1988-2015, Mitchell Jay Richling https://www.mitchr.me All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
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.