Optimization operator

I have introduced this to quite a few colleagues in a form of question “what is the optimization operator in C++/PHP/…?”
The answers varied a lot, people would come up with branch prediction stuff (likely(),etc), and many other ideas, though never right ones.
The answer was pretty straightforward. It works in quite a lot of programming languages:


Simply commenting out code optimizes things better than any other way. Go, try it.

3 thoughts on “Optimization operator”

  1. au contraire, Python has the equivalent: #

    But this is hardly a new idea. FORTRAN has ‘C’, BASIC has ‘REM’, and even many humble assemblers have ‘;’. More to the point, MySQL has ‘–‘ (and ‘#’ too).

    Another powerful optimisation trick: ‘rm’

Comments are closed.

%d bloggers like this: