Quote Originally Posted by S@rK0Y View Post
Superbonzo, at most, Optimization doesn't need a genius programmer
This is your first and probably biggest mistake, because it DOES need a genius programmer, or rather, genius has a wrong conotation, "expert" is a better word.

99.9% of programmers out there have not received any formal training whatsoever in optimization at all.

Some have, but it rarely goes beyond "try a few different approaches and pick the best one" (or rather, pick the one that somehow worked best for the chosen datasets, it could really be the worst of the options when dealing with live data.

THere's only a very few programmers that can look at a bunch of code, or look at a profiler output and see what's wrong and see how to tackle the problem.

And I'm talkign just "code" here. There's actually a bigger amount of optimisation experts when it comes to specific programming related fields such as optimizing/improving SQL queries and improving network related issues, and improving the GPU (3D) pipeline. I don't eally catalogue them as general code optimizers per se, what they do isn't really improving the interaction between their app and 3rd party api's by tailoring the code to suit the needs of the 3rd party API.

modern compilers are very poor things to perform true HPC.
that's because that's not the job of an (optimizing) compiler. You expect the compiler to produce a bunch an object/binary in an acceptable amount of time and that will run the program with a reasonable amount of performance.

Under that ruling, compilers have become incredibly good at what they do. But in the end, they produce 'general purpose code', just like most libraries provide 'general purpose containers and routines'.
SPecialising Always makes code go faster, but compilers and libraries can't afford to go that route, unless you have compilers that are specialized at a particular task (and those do exist). There are compilers out there that will produce facinating blindingly fast code for math problems, but which won't do well on other problem domains.

No magic, Just good Asming does do it for
and you will never know unless you write your fsort WITH if. Compile both with optimizations turned on. and run them side by side on the same computer with the same datasets.
I highly doubt removign a couple if's will produce improvements in the same order as the fsort/qsort comparison (which is comparing apples vs oranges).

microoptimizing doesn't provide that kind of percentage improvement and 'handholding the compiler' definately doesn't.