3 ms·
In Julia multiple dispatch you could just call sin(3 turns) which would dispatch the unit to the optimized nsin. Would the compiler optimize it to be overhead
by singularity2001 4y ago
In Julia multiple dispatch you could just call
sin(3 turns) which would dispatch the unit to the optimized nsin.
Would the compiler optimize it to be overhead free though?
- ChrisRackauckas 4y agoYes, it would devirtualize the dispatches for that kind of thing at compile time if the argument type is known at compile time. See how Unitful.jl works. You can then see inside of the LLVM and native code that it swaps in the required functions.