## Optimising Mandelbrot

In my previous post I showed how I created a Mandelbrot fractal renderer in Clojure, however its performance left a lot to be desired. Optimising code is actually a very good way to learn more about a new language as it teaches you what is going on under the hood. In this post, I will go through the steps I took to drastically improve the application’s performance.

## Inspecting the Code

The first step when optimising code (after *not* optimising of course) is to inspect the code’s logic and find quick fixes to any obvious potential performance areas. The logic of the Mandelbrot code however is fairly easy to reason about as we have built it up from the mathematical formula. Also, looking for obvious performance issues is difficult in a language you are trying to learn, so it’s time to break out the tools.

Read the rest of this entry »

## Rendering the Mandelbrot Set in Clojure

Clojure is a functional language that brings dynamic types and lisp syntax to the JVM. It has a number of features that make it interesting which will be the subject of another post but for now, let’s dive right into some code.

## The Mandelbrot Set

The Mandelbrot set is an example of a fractal which is basically something that can be described using a simple formula and yet exhibit fascinating levels of detail and beauty. I thought it would be a good application to get me started learning Clojure.

Read the rest of this entry »