Monday, November 06, 2006

4 simple changes => 65% faster RB!

Sometimes, having a slow computer makes inefficiencies more obvious. I was renaming classes, and renaming selectors... a lot of them... and hey, the Refactoring Browser was making me wait. Not a whole lot, but like 5 seconds plus a garbage collect for every one of them.

I interrupted one of the operations, found a good place to install a TimeProfiler, let it finish by proceeding in the debugger, and then installed the TimeProfiler after the run was done (yet another big advantage of debuggers in which you can stop and continue, hehe!).

Then, I continued working and started getting TimeProfiler outputs after the operations were done. Based on this information, I made 4 simple changes that resulted in about 65% faster* execution. Very nice! Check out the VWNC list for the details.

* Faster refers to an increase in speed, which is typically defined as amount of work divided by amount of time (e.g., miles traveled per hour, or revolutions turned per minute). Thus, the speed of a program can be seen in terms of iterations/second, and therefore 65% faster means that the new implementation can run 65% more iterations in the same amount of time. If we compare times instead, this speedup means that the new implementation runs in about 60% of the time, because 1/1.65 is about 0.60.

No comments: