i was experiencing some performance drawbacks with complex numbers, so i tried adding , inline:on at the starting push statement, i.e: {.push checks: off, line_dir: off, stack_trace: off, debugger: off, inline:on.}
and now performance x10 and comparable to rust & go,
is there any reason for not using inline here?
I tried to do complex in https://github.com/nim-lang/Nim/pull/8876/commits/826b8915dc33825b47834f8682c84b12e4672f52 3 years ago. It was part of https://github.com/nim-lang/Nim/pull/8876 which it looks like I just withdrew out of probably foolish impatience -- and LTO or even better PGO was/is an alternative with often more information.
@rforcen - you should just try again PR-wise with just complex and learn from any errors in my attempt. But it also sounds like you should learn how to use nim c -t-flto and/or PGO modes of compiling. These can both indeed sometimes pay off with 2+X multiples in performance and are both more general and more automatic than inline annotations.