You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Simple Fractal Benchmark program (in less than 550 lines), console based, .NET Framework 4.7.x (project mono compatible)to measure CPU performance.
Note: that depending on for how complicated the calculations are the results between different CPUs might differ, so tocreate combined single value one would have to execute several different calculations and use a weight on each but fornow I leave that task up for you to solve.
Features
Using
command line arguments or selected by number keys
integer / double math operations for Mandelbrot fractal calculations
singel- or multithreaded code
with / without allocating memory
save to file option (raw dump of iterations in each coordinate, needs reprocessing for generating an image)
with / without repeats (1-99 or endless)
Note: 0 as input or ctrl c (at any time) to exit the program.
Utility
Included utilty (FractRaw2Png) to convert the saved raw dump to PNG that takes width and height as arguments and reading output.dat and creating output.png in the same directory.
FractBench 1253FractRaw2Png 1280 720
Example of usage
Starting FractBench without arguments is very intuitive; just enter from the presented alternatives.
Of the selectable starting locations 1 to 4 they need different processing time to be calculated, with 1 the fastest and 4 the slowest.Location 5 makes it possible to read your own selected from the file location.txt and then process it. If the file could be read its presented as location 5 otherwise 1.
The location.txt is defined by different numbers separated by a new line. Those are (in exact this order):
center x location
center y location
diff or width / height at the specified location
max iterations
Example of location.txt
-0,545205229166666-0,6011456220833330,00000055000
Note: depending on your windows localization settings the decimal point might be . instead.
The size of the generated fractal would also affect total processing time, as well as single threaded (slower) compared to multi threaded (faster).
Memtest1 and Memtest2 are included to generate resolution of 16k x 16k and 32k x 32k, use it if you want longer running elapsed times.Memtest1 in combination with multi threaded and location 2 on a AMD Ryzen 9 5950X could take about 3-4 minutes.
When using save to memory the code will allocate enough memory to store the whole image (and can also save iterations to a file, raw format)or if you select none then memory usage will be less of a factor comparing different computers total execution times. Extended information aboutabout allocated memory, min / max iterations and how many times max iterations was reached are displayed.
The idea of repeating the same selected options several times is to find an average or perhaps a lowest execution time, by running it for example 10 times.Its possible to select from 00 to 99 and selecting 00 will continue repeating until ctrl c is pressed.
Selecting the multithreading selects between single threaded (normal for) and multiple threaded (using Parallel.For)
Multiple (normal) lets .NET select the amount of worker threads
Multiple (optimal) using twice as many threads as logical cores that I found is getting good results with this algoritm
Multiple (free) makes it possible to specify amount of worker threads from 2 to 999 (feel free to experiment with more or less threads than normal / optimal)
Using FractBench with arguments is using the same notation like the input entered with the program without arguments.
Example 1
FractBench 1353
'1' Location 1 (normal / fast calculation intensity; famous Mandelbrot fractal starting location)
'3' a 1080p image (1920 x 1080)
'5' create output.dat file
'3' multi threaded calculation
FractRaw2Png 1920 1080
From the same directory after running the previous command (or move the output.dat to the same directory as FractRaw2Png executable is in)will create output.png from output.dat using the same resolution.
To get 1080p better quality instead generate 4k or 8k image (3840 x 2160 or 7680 x 4320) then downsample (biqubic, bilinear, adaptive or similar) to 1080p (feature not included in FractRaw2Png).
Example 2
FractBench 223103
'2' Location 2 (medium calculation intensity)
'2' a 720p image (1280 x 720)
'3' not saved to memory but with repeat
'10' repeat 10 times
'3' multi threaded calculation
Results
Build for Release, create and run a batch file like this (or just paste this into the command prompt) for comparable benchmark with the results listed below.Also feel free to try other combinations.