Saturday, August 21, 2010

Shapes: Creating an Alternative to the Area Class

See the image on the right?

It's a piece of vector clip art from the collection we use at work.

If I use java.awt.geom.Area objects to calculate its outline: it takes about 3 seconds. But I figured out a way to calculate the same outline in about 120 milliseconds instead.*

This article may look deceptively short, but it's actually my longest article ever. It's so long I had to split it up into several pages.

This article is also my last blog entry for 2010. I have a nice collection of over 50 articles now, and it's time to branch out and explore other hobbies. At least a little. :)

I'm especially proud of this entry, though, and I wanted to go out with a grand finale. So I hope you enjoy.


*OK, so I'll admit this is a rare/exceptional example. But overall I did see more than a 50% improvement in performance for calculating outlines!