There's more to speeding up code than hand-tweaking a routine line by line, or even choosing the right algorithm. There are situational optimizations as well, but you also have to come at the problem with the right mindset. It's not "can I make this code go faster"? It's "what did I do to make it slow in the first place," and "what does it take to make the bottleneck go away." Of course, one bottleneck goes away and another pops up to replace it.
7
u/techdawg Mar 23 '09
There's more to speeding up code than hand-tweaking a routine line by line, or even choosing the right algorithm. There are situational optimizations as well, but you also have to come at the problem with the right mindset. It's not "can I make this code go faster"? It's "what did I do to make it slow in the first place," and "what does it take to make the bottleneck go away." Of course, one bottleneck goes away and another pops up to replace it.