D-Programming-Language/phobos — pull request #2053 by monarchdodra (2014-03-27 12:38:26+00:00)
Title: Tweak min and max for yet more efficiency

I checked the generated assembly code, and it looks pretty damn good. I've not been able to achieve any better anyways.

It reduces calls depth yet some more, by evaluating "lhs" and "rhs", and then always evaluating the max of lhs/rhs "in place" instead of making an extra min(mhs, rhs) call.

Hard to observe noticeable difference in -O -inline -release for small amounts of arguments. It is relatively easy to observe a difference as the amount of arguments increases.

It also makes an immediate difference when compiling without -inline.

Assigning to @andralex.