-
-
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
Very slow compiling when computing big constant arrays #19075
Labels
Comments
Not a solution, but to mitigate the problem, move the const stuff outside for loop. const size = 50_000
const stuff = block:
var a: array[size, int]
a
const zeugs = block:
let inline = stuff
var zeugs: array[size, int]
for i in 0..<size:
zeugs[i] = inline[i]
zeugs
echo zeugs[1] |
survivorm
pushed a commit
to survivorm/Nim
that referenced
this issue
Feb 28, 2023
…stant seqs; don't inline them in the VM; big performance boost (nim-lang#21318) * don't inline arrays in VM * add a test for nim-lang#19075
capocasa
pushed a commit
to capocasa/Nim
that referenced
this issue
Mar 31, 2023
…stant seqs; don't inline them in the VM; big performance boost (nim-lang#21318) * don't inline arrays in VM * add a test for nim-lang#19075
bung87
pushed a commit
to bung87/Nim
that referenced
this issue
Jul 29, 2023
…stant seqs; don't inline them in the VM; big performance boost (nim-lang#21318) * don't inline arrays in VM * add a test for nim-lang#19075
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following example takes almost 4 minutes to compile on an i5-8250U.
Example
Current Output
Expected Output
I would expect the compilation to take less time. The following example compiles in less than one second, despite having equally big constant arrays:
Additional information
The text was updated successfully, but these errors were encountered: