www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - CTFE Memory Hogging Workaround?

reply "Maxime Chevalier" <maximechevalierb gmail.com> writes:
One of the reasons I chose to use D for my project is that I was 
very excited about the prospect of using CTFE in mixin code. 
Unfortunately, there seems to be one (or several?) bugs causing 
CTFE to be very slow and to hog a huge amount of memory (multiple 
gigs of RAM and swap).

Is there some known fix for this? I need this to work now. 
Otherwise, I'm going to have to rewrite my CTFE/mixin code in 
Python or something, which would be a shame, and a waste of time 
on my part.
Nov 22 2012
next sibling parent "bearophile" <bearophileHUGS lycos.com> writes:
Maxime Chevalier:

 One of the reasons I chose to use D for my project is that I 
 was very excited about the prospect of using CTFE in mixin 
 code. Unfortunately, there seems to be one (or several?) bugs 
 causing CTFE to be very slow and to hog a huge amount of memory 
 (multiple gigs of RAM and swap).

 Is there some known fix for this? I need this to work now. 
 Otherwise, I'm going to have to rewrite my CTFE/mixin code in 
 Python or something, which would be a shame, and a waste of 
 time on my part.
Please use D.learn newsgroup for similar questions, this group is not for discussions. There are coding strategies to partially reduce the memory used during CTFE, but in general it uses lot of memory, sometimes too much. This problem is well known and Don is working on it and he has improved the situation a little, but it will take time to fix it well, possibly some months or more. Currently CTFE is not fit for heavy computations. Bye, bearophile
Nov 22 2012
prev sibling parent Jonathan M Davis <jmdavisProg gmx.com> writes:
On Thursday, November 22, 2012 23:07:54 Maxime Chevalier wrote:
[snip]

Please do not post to this list. Only bugzilla is supposed to send messages to 
it (I don't even know why posting is enabled for anyone else). You subscribe 
to it if you want to receive all of those messages from bugzilla.

If you have a bug, please report it at http://d.puremagic.com/issues

If you have a question, please ask it in the D.Learn newsgroup. I'm sure that 
there will be people ready and willing to help you there.

- Jonathan M Davis
Nov 22 2012