Quote:
Someone (you if you try) will always come up with a faster algorithm or high level implimentation.
Always. I'll say it one more time: Always (it might just take a while).
Always? So NP-complete algorithms aren't a problem? I just have to wait till someone figures out a faster algorithm?
If my quicksort is too slow for my needs (Assuming it's running O(lg n) in my case, rather than worst-case O(n^2), I shouldn't look into whether I can schedule the operations more efficiently, but instead try to invent an algorithm that's faster than O(lg n) (which is proven to be impossible in the general case)
Sometimes, waiting for people to come up with a wonder-algorithm just isn't plausible. Either because it might take a few decades before it happens, or because it just isn't possible.
Quote:Low level optimization tricks are not going to get you real speed increases (they didn't even before we got optmizing compilers).
Not true. You can get some pretty decent speed increases that way. There's a lot the compiler can't do. Heck, once you put in a single branch statement, the compiler becomes severely limited in what it can do.
Never mind code paths crossing different functions.
Modern CPU's are pretty damn complex, so, assuming you know what's going on inside them, there tend to be lots of headroom for optimization. Assuming you're willing to start messing about with microoptimizations that may make the code a lot harder to read, and that will make more general algorithmic optimizations harder to perform afterwards.
But usually, CPU's go empty a large part of the time, because the compiler is unable to schedule instructions optimally.
But of course, I agree that you should always start at the highest level, and *only* start messing about with microoptimizations if you're out of other options, and you still *need* additional performance.
Quote:It can order and blend those instructions with a library of micro-optimization techniques (and as mentioned, do it a lot better then you)
Not always. There are plenty of (effective) microoptimizations that compilers can't make because they'd have to make potentially unsafe assumptions about your code (assumptions that you might be able to make, because you know more about the program as a whole), and several others that aren't implemented because computing whether they're safe is too complex. (But again, may be easily done by a human)