Skip to content
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

[regression] Nimscript makes a program slower and more bloated #9995

Closed
narimiran opened this issue Dec 15, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@narimiran
Copy link
Member

commented Dec 15, 2018

When using filename.nims on the latest devel (v0.19.9) it somehow creates a slower and more bloated (more RAM used) program than when you pass the flags directly when compiling. This does not happen on 0.19 stable.

Example

The original command, without .nims file:

nim c -d:release --gc:regions nim/day09

produces a file which runs in ~0.25 seconds, taking ~140 MB of RAM.

Putting --gc:regions in a day09.nims file and compiling it produces a file which runs in ~0.50 seconds, taking ~240 MB of RAM.

This is not limited to --gc:regions, a similar thing happens when using --gc:refc flag with the same file:

  • without .nims: 0.80 seconds, ~330 MB of RAM
  • with it: 2.80 seconds (yes, two seconds slower), ~380 MB or RAM

Expected Output

To have the same/similar results when using the flags on the command line and in .nims file.

Additional Information

$ nim -v
Nim Compiler Version 0.19.9 [Linux: amd64]
Compiled at 2018-12-15
Copyright (c) 2006-2018 by Andreas Rumpf

active boot switches: -d:release

@Araq Araq closed this in 39ae55e Dec 15, 2018

@narimiran narimiran reopened this Dec 15, 2018

timotheecour added a commit to timotheecour/Nim that referenced this issue Dec 16, 2018

@timotheecour

This comment has been minimized.

Copy link
Contributor

commented Dec 16, 2018

the regression was pretty serious, leading to using 100% CPU and eating up all the RAM, ending up crashing my macbook pro 16GB RAM

see my PR to fix it: #10007

timotheecour added a commit to timotheecour/Nim that referenced this issue Dec 16, 2018

nc-x added a commit to nc-x/Nim that referenced this issue Dec 16, 2018

Revert "fixes nim-lang#9995"
This reverts commit 39ae55e.

nc-x added a commit to nc-x/Nim that referenced this issue Dec 16, 2018

Revert "fixes nim-lang#9995"
This reverts commit 39ae55e.

nc-x added a commit to nc-x/Nim that referenced this issue Dec 16, 2018

Revert "fixes nim-lang#9995"
This reverts commit 39ae55e.

@Araq Araq closed this in bae662f Dec 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.