Files
Obsidian_Informatik/Semester 2/GRA/Presentation.md
T
2026-09-16 00:39:13 +03:00

21 lines
4.0 KiB
Markdown

And now we come to the benchmarking. Here we want to look at what we achieved with the different implementations. To see what speedups they yield we have prepared a suite of 4 tests:
- Test 1: A default FHD image
- Test 2: 8K image with ultra low iterations
- Test 3: Normal image, zoomed on the fractal edge with high iterations
- Test 4: Fully black with high iterations
# Test 1
Now we will look at the results of Test 1 which is comprised of a default FHD image. This is meant to test the average use case of the program. In it we see a speedup of 3.33 from SIMD. And a speedup of 6.01 from threading. There is almost no difference between V0 and V2, with V0 - being more optimized having a slight advantage.
# Test 2
We move on to the second test which is an 8K image with very low iterations. This is meant to move away the focus from the calculation itself. And should theoretically deliver lower speedups from SIMD. And as you can see the results are as expected. It has a lower speedup from SIMD - approximately 1.96. This is primarily due to the low iteration count. The pixels escape very quickly and the amount of calculations that need to be done for each pixel is less, so the performance is not as impacted by the optimizations done on the calculation. What matters here is the time for memory access and because you have writes much more often and because the image is bigger - so in general a higher count of writes. The performance is dependent on memory access and not on the calculation.
The speedup from threading is a bit higher due to the 10 row lower limit for pixels per thread. That means that in the first test only 108 out of the 128 cores can be utilized. While in the second one all cores of the CPU can be used. There is a small improvement in V0 over V2, but it is negligible.
# Test 3
The third test is a normal resolution image on the edge of the fractal with high iterations. This is meant to test the edges of the fractal where in SIMD there might be groups of 4 pixels in which some escape while the others still have not. This means the ones that have escaped need to wait for the others which limits the speedup. The speedup from SIMD here is - 3.59 which we will see later is lower compared to Test 4 - the practical best case for the algorithm.
The speedup from threading is 18.79 - higher than the previous two tests. This is due to the higher iteration count. With higher iterations the overhead for creating threads is relatively lower compared to the work being done for the calculation. So splitting the work for the calculation here over multiple threads reaps more benefits. The small speedup from V0 over V2 is still relatively the same.
# Test 4
This test is a purely black image with high iterations. Purely black means that all of the pixels reach their maximum iterations before escaping. Combined with the high iterations this makes Test 4 the optimal situation for SIMD and threading. For SIMD this means that most of the time is spent on the calculation and not on memory access. So in practice this yields the best speedup we have seen from SIMD - 3.64 which is also the closest to the theoretical speedup of 4. What keeps it from reaching that is managing the divergence mask which is more complicated then checking if one pixel has escaped, the fact that the memory writes are still scalar and the overhead spent for packing floats into 128 bit registers.
On the other hand the speedup from threading alone is 68.50 - the best of all the tests. The case is the same as in Test 3. However we have an additional speedup due to the fact that the workload for all the pixels is distributed totally evenly. The whole image being black means that all of the threads finish at the same time because they have to run the same amount of calculations and there is no thread that is waiting for another. The small speedup from V0 over V2 stays consistent.
Now we have looked at how the different versions behave in different scenarios and why and with that i would like to finish the presentation. Thank you for your attention!