-
-
Notifications
You must be signed in to change notification settings - Fork 5.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
In REPL, ((1:10000)...);
eats all memory and hangs.
#14126
Comments
Interestingly, |
It seems to have to do with the display of the tuples (even if output is supressed with
With
(avoiding the lambda with a generic function cuts the time by half (roughly), and allocates 1.1GB less). |
All the time seems to be in LLVM. We're generating code like this:
and it goes on like that for every element of the tuple. This is in the code for boxing a struct containing a big tuple after an sret, in a jlcall wrapper. Looks like we should use a memcpy after a certain threshold? Or is it possible to allocate the box first, and sret directly into it? cc @vtjnash @Keno |
Update: confirmed this code is generated by the SROA pass. This also interacts badly with jb/functions during the tests, making some of them take much longer. |
i think the problem is that we (the frontend) aren't supposed to be creating ArrayTypes of this size, and should instead be switching to malloc'd opaque pointers (or preallocated boxes) for this usage pattern. |
That would be fine. I think the biggest problem there is that we could lose optimizations that rely on structs being SSA values, for example reusing the space for structs with disjoint lifetimes. Can LLVM be told that malloc'd storage has "value" semantics and can be optimized this way? Of course this is a detail that may not matter much (after all, we're not running into the particular issue here very often as it is). |
yeah, i think the priority here can be (1) make it work (2) make it optimized |
|
In REPL
eats 4G of memory and hangs while running at 100% of CPU.
However, it works, albeit very slowly, with
The text was updated successfully, but these errors were encountered: