Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
65 lines (40 sloc) 1.67 KB
module Y2018.M03.D08.Exercise where
Let's try something different today.
@wtfunctional has a image draw tutorial with the Mandelbrot set:
Download and compile it, following the hints at
import Data.Time.Clock
timedMandelbrot :: FilePath -> IO ()
timedMandelbrot outputpng = undefined
Have timedMandelbrot call the mandelbrot set-maker, but then report out how
long it takes to create a mandelbrot set image
smallerMandelbrot :: FilePath -> Int -> Int -> IO ()
smallerMandelbrot outputpng = undefined
Create a mandelbrot set image that is 1/3 the size of the default. How do you
do that? What functions do you call? How long did that take?
{-- BONUS -----------------------------------------------------------------
So, generating a mandelbrot set takes a while. Do you see any obvious bottle-
necks? Do you see any algorithmic improvements that will speed up the image
generation? *hint* profiler
*another hint* The mandelbrot set is an 'embarrassingly parallel' problem.
*COUGH* threads? *COUGH* STM? *COUGH*
One thing I did was to make the iteration/escape-test to be 100 instead of 1000.
What is the trade-off there?
Or there're approaches discussed in wikipedia:
{-- BONUS-BONUS -----------------------------------------------------------
We've all seen galleries of 'zooming' into the Mandelbrot set. How would you
do that here?