|
|
|
|
|
by pflanze
1372 days ago
|
|
FWIW, I implemented[1] the exact same algorithm (except only using 2-way SIMD instead of 4-way as that's what my computer at the time supported, and relying on OpenMP's dynamic scheduling for multi-core, and doing grayscale rendering instead of color) in C 9 years ago. I did care about proper alignment, and IIRC it did help performance. I kept the relevant changes and discoveries in the commit log, although can't see right now what happened without alignment. The code is pretty ugly since I'm not relying on any auto-vectorization at all. I guess I should check which of our versions runs faster. [1] in the "c" folder in https://github.com/pflanze/mandelbrot (I also implemented the same algorithm again in C++ later on, cleaner, but haven't published that (yet).) |
|
If you'd like to compare yourself, change `depth` in main.c to 1000, `w` and `h` in `renderScene` to your image size, and change `xcenter`, `ycenter`, and `size` to values that correspond to yours (size is simply the width of the picture in mandelbrot values, instead of pixels). Ah, but it still calculates only 2 pixels at a time, I'll need to look into that tomorrow.