When upgrading from CentOS 6.3 to 6.4 we noticed that our code ran noticeably longer, sometimes up to a factor two longer. We could track this down to serious CPU time regressions in the glibc math library. We have investigated 4 routines in the math library: exp(), pow() and sin() all showed CPU time regression to varying degrees, while expf() clearly is faster (though we rarely use that in our code). We have not investigated other routines, but we suspect that many more routines will show CPU time regressions.<br />
<br />
These are the timings (in seconds) we got for the attached program:<br />
<br />
CentOS6.3 CentOS6.4 AMD<br />
exp(): 12.17 47.03 9.38<br />
<br />
Using a slightly modified version of the program we found:<br />
<br />
pow(): 28.94 63.57 24.05 [x += pow(x,-0.9)]<br />
sin(): 158.91 192.35 14.43 [x += sin(x)]<br />
expf(): 93.92 10.58 8.35 [x += expf(-x)]<br />
<br />
Though the speedup of the single-precision routine expf() is certainly welcome, it looks like it has been achieved at the expense of serious regressions in the double-precision routines (exp() almost by a factor 4, pow() more than a factor 2). Since the use of the double-precision variants will likely be dominant (it certainly is in our code) this needs to be fixed urgently. It is also obvious that the sin() function (and likely other trigonometric functions) is embarrassingly slower than the AMD version...
↧