bow-simulation / virtualbow

Software for designing and simulating bows
http://www.virtualbow.org/
GNU General Public License v3.0
21 stars 3 forks source link

Speed up C++ math functions with this weird trick #218

Closed stfnp closed 2 years ago

stfnp commented 2 years ago

Apparently C++ standard math functions (sin, cos, sqrt etc.) can be much faster if the -fno-math-errno flag is set: https://medium.com/@ryan.burn/why-standard-c-math-functions-are-slow-d10d02554e33

Could be done without losing anything, since we don't use the error handling anyway.

stfnp commented 2 years ago

https://stackoverflow.com/questions/3134660/how-to-apply-different-compiler-options-for-different-compilers-in-cmake

stfnp commented 2 years ago

Done. No noticeable performance improvement at first glance (maybe the difference could be measured with some benchmarking).