-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why nim-1.6.20 only takes 2s but nim-2.0.14 66s when calculating fib(46) #24574
Comments
Memory management changed? |
@juancarlospaco This is a table of testing gc and threads in nim-2.0.14:
|
With |
Of course, the analysis must go deeper and perform a disassembly of the executables to see if there is a difficulty for the C compiler to optimize (pre-calculate) the C code generated by Nim with |
Sure! |
You don't have to change the exceptions mode globally, a single proc fib(n: int): int {.quirky.} =
if n <= 1:
return n
else:
return fib(n - 1) + fib(n - 2)
I doubt 1.6 supports this annotation though. |
@Araq After adding the pragma |
The nim-1.6 uses a cheat that nim-2.0 could reimplement but it pretty much improves the one meaningless fib benchmark and nothing else. You still get this cheat with 2.0 and |
Maybe |
Description
Nim-2.0.14 takes too long time (about 66s) when calculating fib(46) than nim-1.6.20 (only 2s), and nim-2.0.8 also takes 33s.
The test case
Nim Version
nim-1.6.20, nim-2.0.8, and nim-2.0.14
Current Output
Expected Output
Known Workarounds
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: