Thursday, June 11, 2009

I am the optimator

I made a couple of updates, like removing the standard Ugen functions(chan, gain, last...) from non-Ugen autocomplete items(Std, Machine, Math...). Most importantly, though, I started optimizing the code. I wrote a new class called PerfTimer which does timer operations with more precision than GetTickCount(). I've been using that to benchmark performance. I also came across this class, which benchmarks a method by calling it many times over and timing it. I'll have to look into it later.

I got rid of all of the nasty try-catch statements (can be performance hogs), and I replaced 90% of the foreach loops in the TextEditor class with for loops. There was a nasty slowdown in the function for updating the line numbers, and that was due to me using a string(immutable) instead of a StringBuilder(ding!). Also, updating line numbers now only happens when the number of lines have changed since the last time the text changed. It seems that I will need to optimize as much of the code as I can before I can start implementing syntax highlighting, because highlighting has been a hog so far.

A little off topic, but last night I went to a place called the Biergarten, where I imbibed a delicious dark beer, the Spaten Optimator. The taste is malty and rich, and it stays in your mouth even after you have consumed said beverage. Highly recommend it.

No comments:

Post a Comment