https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91936
Bug ID: 91936 Summary: Slowness in exp() Product: gcc Version: 4.4.7 Status: UNCONFIRMED Severity: normal Priority: P3 Component: other Assignee: unassigned at gcc dot gnu.org Reporter: waikng at hotmail dot com Target Milestone: --- Created attachment 46982 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46982&action=edit slow exp() example I found two arrays of double numbers in our application such that the calculation time of exp() for the first set is at least twice slower than the other one. Please see attached the example. It calculates the mean of the two arrays four times. In the output, the first column is the calculation time and the second column is the mean. It shows about 11 microseconds versus 4 microseconds consistently on our PC with -O -m64. We have gcc 4.4.7 and /lib64/libm-2.12.so. I can also replicate this with gcc 6.5.0 in an online compiler (https://www.onlinegdb.com/H1CATk3DH). In some other case, of which I haven't extracted the arrays out, our application is even four times slower. When I implement an exp() algorithm myself we don't see the performance degradation, so I believe there is some issue about the stock exp(). Also I don't see this degradation on my personal MacBook Pro running XCode 10.2.