-
Notifications
You must be signed in to change notification settings - Fork 68
Bring Nim to C speed #17
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
Conversation
|
Also it seems that adding flto slowed down Nim (previous results in readme were 0.55 for markAndSweep and 0.95 for default GC) |
|
@Yardanico That is not LTO, that was a pity bug in the benchmarking code which was fixed in ee670ed |
|
@frol ah, ok :) |
|
Please, fix the conflict. It seems that after you fix it, we will see the diff to be only around |
|
Basically there is an issue currently in the Nim GC, that triggers it twice when the resulting value is a reference type: one when the Nim sees the result value (cancelled by noInit) and a second time when it's constructed. I'm fixing the conflict, but seems like I will have to do it from Github interface from my editor it creates new conflict :/. |
|
It should be good to go now. |
|
|
I see you merged master over your branch... Please, consider using |
|
I took the new main.nim and compiled it on my Linux machine and it doesn't produce any measurable difference in performance in neither of the configurations. Weird! |
|
@frol what about nim devel? :) |
|
Ah right, the {.noInit.} pragma is ignored on Nim stable due to this regression: nim-lang/Nim#7743 |
|
Well, guys, we are all on stable, I spent the whole day only dealing with stable compilers, and I certainly don't want to maintain all the modifications and tricks with unstable/dev releases. The original idea of the benchmark was to see what we can write in a reasonable time without doing obviously stupid things (e.g. we missed |
|
No problem, then I'll reopen a new PR once the new Nim stable hits. |
Most Nim users tend to use the dev version anyways, there's always neat stuff on those that haven't made it into a release yet. Plus with @mratsims changes and a few changes of my own I was even able to bring the Nim version with markAndSweep down to under C++ raw pointer speed, all while using only 880Kib of memory instead of the 5MiB you have Nim listed at currently.. |





This brings Nim from
to
on my machine (i5-5257U dual core 2.7Ghz Broadwell)