Re: CTFE slower than expected

2012-05-30 Thread deadalnix
Le 29/05/2012 23:53, Walter Bright a écrit : On 5/29/2012 8:06 AM, Manu wrote: On 29 May 2012 15:52, Don Clugston d...@nospam.com mailto:d...@nospam.com wrote: On 29/05/12 12:25, Manu wrote: Is there any way to improve it? Oh yeah. Orders of magnitude, easily. The slowness is not in any way

Re: CTFE slower than expected

2012-05-30 Thread Don Clugston
On 29/05/12 23:23, Philippe Sigaud wrote: On Tue, May 29, 2012 at 2:52 PM, Don Clugstond...@nospam.com wrote: Is there any way to improve it? Oh yeah. Orders of magnitude, easily. ! The slowness is not in any way inherent to CTFE. The experience will be completely different, once I

CTFE slower than expected

2012-05-29 Thread Manu
I've been trying to work out why my compile times have gone to hell recently. I have a lib, it takes 3.5 seconds to compile. I add one CTFE heavy module, it's not huge, certainly much smaller than the rest of the app, and it blows out to 18 seconds. I've done some experiments removing bits and

Re: CTFE slower than expected

2012-05-29 Thread Michel Fortin
On 2012-05-29 10:25:54 +, Manu turkey...@gmail.com said: What are the bottlenecks? Is there any way to improve it? The answer to those questions is usually found by profiling. Asking people for what they think is slow is almost certain to give you wrong answers. -- Michel Fortin

Re: CTFE slower than expected

2012-05-29 Thread Manu
On 29 May 2012 14:28, Michel Fortin michel.for...@michelf.com wrote: On 2012-05-29 10:25:54 +, Manu turkey...@gmail.com said: What are the bottlenecks? Is there any way to improve it? The answer to those questions is usually found by profiling. Asking people for what they think is

Re: CTFE slower than expected

2012-05-29 Thread Jacob Carlborg
On 2012-05-29 12:25, Manu wrote: I've been trying to work out why my compile times have gone to hell recently. I have a lib, it takes 3.5 seconds to compile. I add one CTFE heavy module, it's not huge, certainly much smaller than the rest of the app, and it blows out to 18 seconds. I've done

Re: CTFE slower than expected

2012-05-29 Thread Manu
On 29 May 2012 15:10, Jacob Carlborg d...@me.com wrote: On 2012-05-29 12:25, Manu wrote: I've been trying to work out why my compile times have gone to hell recently. I have a lib, it takes 3.5 seconds to compile. I add one CTFE heavy module, it's not huge, certainly much smaller than the

Re: CTFE slower than expected

2012-05-29 Thread Don Clugston
On 29/05/12 12:25, Manu wrote: I've been trying to work out why my compile times have gone to hell recently. I have a lib, it takes 3.5 seconds to compile. I add one CTFE heavy module, it's not huge, certainly much smaller than the rest of the app, and it blows out to 18 seconds. I've done some

Re: CTFE slower than expected

2012-05-29 Thread Manu
On 29 May 2012 15:52, Don Clugston d...@nospam.com wrote: On 29/05/12 12:25, Manu wrote: Is there any way to improve it? Oh yeah. Orders of magnitude, easily. The slowness is not in any way inherent to CTFE. The experience will be completely different, once I have some time to work on it

Re: CTFE slower than expected

2012-05-29 Thread Jacob Carlborg
On 2012-05-29 14:37, Manu wrote: That's interesting. I can probably give that a shot. So you think that's a bigger cost than the CTFE code that generates the strings? I don't know. I just did a test with Derelict that needed to be compatible with D1 and D2 and therefore used string mixins

Re: CTFE slower than expected

2012-05-29 Thread d coder
Alright, well I've got a case of beer with your name on it if you can pull it off! ;) +1. I too am waiting for CTFE improvements. I am working on a DSL and with the present limitations, it is impractically slow and memory consuming while compiling.

Re: CTFE slower than expected

2012-05-29 Thread Philippe Sigaud
On Tue, May 29, 2012 at 2:52 PM, Don Clugston d...@nospam.com wrote: Is there any way to improve it? Oh yeah. Orders of magnitude, easily. ! The slowness is not in any way inherent to CTFE. The experience will be completely different, once I have some time to work on it -- I know exactly

Re: CTFE slower than expected

2012-05-29 Thread Walter Bright
On 5/29/2012 8:06 AM, Manu wrote: On 29 May 2012 15:52, Don Clugston d...@nospam.com mailto:d...@nospam.com wrote: On 29/05/12 12:25, Manu wrote: Is there any way to improve it? Oh yeah. Orders of magnitude, easily. The slowness is not in any way inherent to CTFE. The

Re: CTFE slower than expected

2012-05-29 Thread bearophile
Walter Bright: tl,dr: CTFE started out as a glorified constant folder, not an interpreter. An interpreter needs a different design. And I presume a basic JITting interpreter for CTFE (like one in LDC2 using existing LLVM JIT tools) needs yet another design. Bye, bearophile

Re: CTFE slower than expected

2012-05-29 Thread Andrej Mitrovic
On 5/29/12, Don Clugston d...@nospam.com wrote: Oh yeah. Orders of magnitude, easily. Does this also imply speedups for static foreach loops? I've got quite a few of those and they seem to slow down compilation a bit. I've had a funny error message once saying there's an error on line ~50_000 in