On Thursday, 6 April 2017 at 20:49:00 UTC, Nierjerson wrote:
I am running out of memory trying to generate CTFE code. It is quite large generation but just repetitive loop acting on an array item.
CTFE is a memory hog, and there's not much you can do about it. A new CTFE engine is in the works, and it's "coming soon".
I can tell you that if the array is actually an AliasSeq or a compiler tuple then what the compiler is doing is generating a new chunk of code for every loop iteration and then interpreting that, leading to O(n) memory used for the loop. Also, try to reduce your template instantiations as much as possible.
