Linked by Thom Holwerda on Fri 13th Feb 2009 16:19 UTC, submitted by ShlomiFish
General Development There's a new essay called "Optimizing Code for Speed" available on Shlomi Fish's site. It covers the motivation, methods and terminology of optimizing code, and provides many links and examples to illustrate this important subject.
Permalink for comment 348783
To read all comments associated with this story, please click here.
find the bottleneck.
by renhoek on Fri 13th Feb 2009 22:53 UTC
renhoek
Member since:
2007-04-29

the number one priority when optimizing is finding the bottleneck. optimizing for memory useage makes no sense when the program is slow because it waits for io, and vice versa.

anybody out there, benchmarking is the ONLY way to make your program faster. i've seen people "optimize" code which didn't need optimizations and ended up with a piece of unmaintainable crap.

please, benchmark, benchmark and benchmark again. just because you think something is slow does not make it slow. i've tried that in the beginning and i've been proven wrong too many times.

bottleneck is the what and benchmarking is the how when optimizing.

and just a general tip, don't be too smart. other software writers optimize for the most common case.

Reply Score: 3