March 24, 2009 will

Micro-optimizing Minilight

Today I discovered a rather cool project via Reddit. MiniLight is a “minimal global illumination renderer” (it draws 3D scenes) with implementations in various languages.

The Python version is a lot slower than the compiled languages – which is to be expected, number crunching like this is not Python's forte. All the same, I had a go at optimizing it. Using similar techniques I wrote about in a previous blog post I reduced the run-time for the test scene from 61.4 seconds to 53.2 seconds. Hardly stellar, and it's not going to change the comparisons, but it was an interesting exercise.

It may be possible to optimize it further without resorting to a different Python implementation, but that is an exercise for another day. See the following link for my micro-optimized version:

Download minilight_wm.zip

Use Markdown for formatting
*Italic* **Bold** `inline code` Links to [Google](http://www.google.com) > This is a quote > ```python import this ```
your comment will be previewed here
gravatar
Calvin Robinson
More to the point, what were you doing on Reddit, you traitor :P