Closed ab-cpp closed 7 years ago
The issue is that glibc's math functions are slow. Solutions include using an alternative libm, such as the ones from AMD and Intel (only optimized for their own processors, and closed source), or getting an optimized implementation from elsewhere.
For example, I tested https://github.com/herumi/fmath - replacing the exp() call with fmath::expd() improved the speed from 34ns to 9ns on my system. And that free implementation is quite likely not as good as the ones from the processor manufacturers, which are likely used in the Windows and OS X libm.
Does this qualify for the bounty? There is no simple, open source solution - nobody has made an optimized, open source libm that would target processors from all manufacturers.
Yes, unless someone posts a significantly better answer you will get the bounty. I guess I should have tried stackoverflow first :)
http://www.agner.org/optimize/blog/read.php?i=209&v=t This has more background on math libraries.
Why is Ubuntu so much slower and how can we fix this issue ?