Re: Speed up compilation of CTFE-heavy programs with this One Weird Trick!

2016-11-03 Thread Vladimir Panteleev via Digitalmars-d
On Thursday, 3 November 2016 at 12:19:09 UTC, Sönke Ludwig wrote: Does "if (!_ctfe) assert(false);" work, too? That would also protect against accidential mistakes. Doesn't seem like it. { assert(false); return; } works (in reducing compile time) but generates "statement is not reachable"

Re: Speed up compilation of CTFE-heavy programs with this One Weird Trick!

2016-11-03 Thread Jacob Carlborg via Digitalmars-d
On 2016-11-03 04:43, Vladimir Panteleev wrote: As it turns out, DMD will codegen all functions, even templated ones when they're instantiated, whether they're called by something or not. With metaprogramming-heavy code, it's easy to run into some optimizer performance corner cases, however this

Re: Speed up compilation of CTFE-heavy programs with this One Weird Trick!

2016-11-03 Thread Sönke Ludwig via Digitalmars-d
Am 03.11.2016 um 04:43 schrieb Vladimir Panteleev: For each function that is only called during compilation (e.g. for code generation), at the top add: if (!__ctfe) return; That's it. For one project, this brought compilation time (with optimizations) from over an hour down to

Re: Speed up compilation of CTFE-heavy programs with this One Weird Trick!

2016-11-03 Thread Dmitry Olshansky via Digitalmars-d
On 11/3/16 5:20 AM, Andrei Alexandrescu wrote: On 11/02/2016 11:43 PM, Vladimir Panteleev wrote: For each function that is only called during compilation (e.g. for code generation), at the top add: if (!__ctfe) return; That's it. For one project, this brought compilation time

Re: Speed up compilation of CTFE-heavy programs with this One Weird Trick!

2016-11-03 Thread Era Scarecrow via Digitalmars-d
On Thursday, 3 November 2016 at 03:43:06 UTC, Vladimir Panteleev wrote: For each function that is only called during compilation (e.g. for code generation), at the top add: if (!__ctfe) return; That's it. For one project, this brought compilation time (with

Re: Speed up compilation of CTFE-heavy programs with this One Weird Trick!

2016-11-02 Thread Andrei Alexandrescu via Digitalmars-d
On 11/02/2016 11:43 PM, Vladimir Panteleev wrote: For each function that is only called during compilation (e.g. for code generation), at the top add: if (!__ctfe) return; That's it. For one project, this brought compilation time (with optimizations) from over an hour down to