Stage 4: Optimized Code
Here we can see the final version of the applet. The renderImage function has been re-written and the functions it calls have been "inlined". It now also uses integer arithmetic which Java can process considerably more quickly.
Stage 1: Original applet
Stage 2: Locks Removed
Stage 3: Unoptimized Code
Stage 4: Optimized Code