Ref counting for CTFE?

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Thu May 29 09:16:26 PDT 2014


On Thu, May 29, 2014 at 01:13:39PM -0300, Ary Borenszweig via Digitalmars-d wrote:
> On 5/29/14, 12:22 PM, Steven Schveighoffer wrote:
> >One subject that frequented the talks at dconf was the poor
> >performance of CTFE and mixins.
> >
> >The major issue as I understand it (maybe I'm wrong) is the vast
> >amounts of memory the compiler consumes while building mixin strings.
> >In fact, one of the talks (can't remember which one) mentioned that
> >someone had to build their project in steps so the compiler did not
> >crash from OOM.
> 
> If you add reference counting or a GC to the compiler, it will make
> those large projects compile, but it will inevitably be slower than
> now. That's why Walter disabled GC completely in the compiler (turning
> it on made the compiler really slow).
> 
> I think the right steps are:
> 
> 1. Enable some kind of GC
> 2. Profile and see where are the bottlenecks.
> 3. Optimize those cases.
> 4. Go to 2.

Shouldn't be as simple as a compiler switch to enable compile-time GC?


T

-- 
The day Microsoft makes something that doesn't suck is probably the day they start making vacuum cleaners... -- Slashdotter


More information about the Digitalmars-d mailing list