2 ms·
My gut instinct was that operations like sin, cos, tan, etc, were the kind that would get aggressively inlined by any modern compiler, and then after inlining t
by cbondurant 1mo ago
My gut instinct was that operations like sin, cos, tan, etc, were the kind that would get aggressively inlined by any modern compiler, and then after inlining the redundant conversions between radian/turns would be canceled out by optimization passes.
Of course, gut instinct can be wrong, so I checked in godbolt and was surprised to find out that even if I try to force lto, it still doesn't get inlined and remains a call.
- aerzen 1mo agoI don't think compilers are smart enough to realize that multiplication with tau, followed by multiplication of 2/pi should be simplified away. Also, sin is probably used so much that inlinung would probably inflate binary size significantly.