Using AQtime to Measure Performance
"When I’m wearing my 'developer hat' I regularly use AQtime to measure the performance of new critical code. Like most developers, I try to write code that’s optimized for performance right off the bat, and like most developers I sometimes find that my optimizations didn’t predict the real-world usage of my code. Profiling new routines with AQtime would sometimes be a humbling experience, because I’d discover that my code wasn’t as fast as I thought, but I’d rather be told that by a performance profiler than a customer," said Nick.
"In addition, before every new beta release I’d wear my 'customer hat' and simply use FeedDemon for several hours just as any end user would, except I run it with AQtime. This is enormously helpful in locating performance bottlenecks, because it enables me to see not only how specific routines perform, but also how often those routines are called in normal usage. I am often surprised to find that the bottlenecks weren’t where I thought they would be. In many cases, they are in routines that I didn’t think would affect performance as they were written for clarity rather than speed."
"For example, FeedDemon uses dozens of string-handling routines that I wrote for another project. These routines performed fine with the other application, but FeedDemon is extremely string intensive so performance problems in these routines had a far greater impact on FeedDemon than on my other project. Using AQtime I discovered that a seemingly innocuous routine that is used to remove HTML tags from a string was having a significant impact on FeedDemon’s performance. It was among the most poorly performing routines in FeedDemon, yet I never even considered that it would be a problem. After the routine was rewritten, FeedDemon seemed to be much more responsive overall and AQtime, once again, proved to be correct."
Nick looks for two key performance indicators: real performance, or the actual execution time of a routine, and perceived performance, how fast a program feels to the end user. "One area where perceived performance is critical is at startup time. If an application appears to start slowly it will be regarded as slow and bloated regardless of how fast it really is," said Nick.
"I spent quite a bit of time making sure that FeedDemon started quickly, and this is trickier than you might think because there are so many things that can affect load time. AQtime’s triggers are very handy here, because they enable me to see exactly which routines are being called at startup before the end user actually sees the main application window. By re-arranging and/or rewriting these routines, I am able to significantly increase how quickly FeedDemon appears to start."