Updates to the WindowsAPI translation instructions; D2 only?

Jonathan M Davis jmdavisProg at gmx.com
Fri Aug 2 02:19:55 PDT 2013


On Friday, August 02, 2013 10:06:34 Stewart Gordon wrote:
> But that does suggest that good old C macros are considerably quicker to
> compile than mixins.

Strings get allocated and operated on when you're doing string mixins rather 
than simply doing textual replacement like occurs with macros.

> I haven't tried to compare them.  I suppose that, now
> that computers are several orders of magnitude faster than they were 30
> years ago, D has focused on other objectives than being as fast as possible
> to compile.

Not really. What it comes down to is that CTFE is horribly slow due to the 
fact that it was originally implemented essentially by hacking it into the 
compiler rather than integrating it a clean manner. For instance, at present, 
_every_ time that it mutates a variable (including stuff like ++i), it 
allocates a new value on the heap. When you're doing stuff that, performance is 
going to absolutely tank. What's there is really quite scary. Don's been 
working hard on cleaning it all up so that he can actually start fixing the 
efficiency problems, and he's getting close, but until CTFE's performance 
problems are fixed, stuff like string mixins are going to be slow. However, once 
CTFE's core implementation problems have been fixed, the situation should 
improve considerably.

- Jonathan M Davis


More information about the Digitalmars-d mailing list