www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Performance problem with std.math.abs

I have found a performance problem on abs() that I don't 
understand:

http://codepad.org/guZyeFOK

In that little program core.stdc.stdlib.abs leads to a much 
faster (11 or 12 times faster with DMD on Windows32, compiling 
with -O -release -inline -noboundscheck) program compared to 
using std.math.abs, despite (as shown in the asm) 
core.stdc.stdlib.abs is not inlined.

Do you understand what's going on?

Bye,
bearophile
Jan 29 2013