Wednesday, January 26, 2005

Optimize, Shmoptimize. Pancakes are the thing.


Yeah, I've heard it before, that idea that you shouldn't optimize early, like before 7am. Well, it's 6:52am and I've spent the last six hours optimizing and I've had it up to here (you can't see but I'm pointing to my neck).

This all started when a couple of people using Ceryle thought it was locking up while visualizing a Topic Map, when I was pretty sure it wasn't locking up, it was just taking a damned long time. Part of the problem was a lack of feedback. A few days ago I tried get the progress bar working again, but found that when I managed to get it redraw properly, it was now a competing Thread (if it ever got enough time to redraw itself consistently) and bumping an 11 second visualization, Ceryle's Large Graph, up to over 47 seconds. This doesn't sound like a huuuge amount of time, but when you're waiting 47 seconds for something that should take four seconds and your computer just went all mysterious on you, well, you think about giving up, moving to the Bahamas, pouring your life into a bottle of dark rum and watching the hot oiled bikini action on the beach from a sling chair.

I still think about that, but I decided to optimize. So I got out my slide rule and pocket protector and went to work. I changed the visualizer from an invisible object to being a dialog box, wrote a bit of code to spit out performance statistics so I could see what was making a difference, and by golly, if I didn't get that 11 second visualization consistently down to 6 seconds, and sometimes below 4 seconds. It even looks nice and has a functional progress bar of its own. Being the month of January, visualizing Topics was always fast, but the Associations were like molasses. Now they're a bit like BC Golden Cane Sugar, which is excellent on pancakes. And oh, do I like pancakes. If you're ever in San Francisco, you gotta check out the It's Tops diner on 1801 Market (cross street is Valencia, if I remember right), as their blueberry buckwheat pancakes are the best pancakes in the entire world.