dougo: (Default)
dougo ([personal profile] dougo) wrote2004-06-17 07:50 pm

The Zen of optimization

I've been trying off and on for months to make this program I'm working on go faster. It basically involved squinting at a lot of profiler output, not learning anything, and randomly adding memoization hoping it would make a difference (it didn't).

Today I've been working on something else, and I accidentally made the program run four times faster.

I'm not sure what the moral of the story is (besides that I need a better profiling tool), but it made me happy so I thought I'd share.

(Side note: be very careful when using weak pointers. Yesterday my program was producing a different error every time it ran—a program that I thought was entirely deterministic, so this was very disconcerting—and I tracked it down to a weak table that shouldn't have been weak. D'oh!)

[identity profile] mshonle.livejournal.com 2004-06-18 02:21 am (UTC)(link)
OK! Give us the details! What was the program? Was this in Java?

[identity profile] mattsnaps.livejournal.com 2004-06-18 06:53 am (UTC)(link)
Yeah, it does sound like you need a better profiling tool. I know a guy who worked on one of those once, then quit to go to grad school. Wonder if he's on Livejournal.