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!)

From: [identity profile] mshonle.livejournal.com


OK! Give us the details! What was the program? Was this in Java?

From: [identity profile] dougo.livejournal.com


It's an example program for my thesis language (Socrates), which is embedded in Scheme. The changes I made were to the language implementation, actually, not the program itself, but the 4x speedup is when running the example program (a little GUI solitaire puzzle involving putting dominos on a grid).

From: [identity profile] mattsnaps.livejournal.com


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.

From: [identity profile] dougo.livejournal.com


Ha ha. I didn't actually work on Quantify, but I did briefly think about whether there was some way I could use it on the output from the Scheme profiler. But
  • it'd probably be some non-trivial work to translate to its data format
  • it's neither free nor cheap (though maybe they still offer evaluation licenses)
  • I'm pretty sure there's something wrong with the Scheme profiler output, too, so it's not just a visualization problem.
.

Most Popular Tags

Powered by Dreamwidth Studios

Style Credit

Expand Cut Tags

No cut tags