On Wednesday, 1 April 2015 at 02:25:44 UTC, Random D-user wrote:
I've used D's GC with DDMD. It works*, but you're trading
better memory usage for worse allocation speed. It's quite
possible we could add a switch to ddmd to enable the GC.
As a random d-user (who cares about perf/speed and just
happened to read this) a switch sounds VERY good to me. I don't
want to pay the price of GC because of some low-end machines.
Memory is really cheap these days and pretty much every machine
is 64-bits (even phones are trasitioning fast to 64-bits).
Also, I wanted to add that freeing (at least to the OS (does
this apply to GC?)) isn't exactly free either. Infact it can be
more costly than mallocing.
Here's enlightening article:
https://randomascii.wordpress.com/2014/12/10/hidden-costs-of-memory-allocation/
I think a switch would be good. My main reason for asking for
such a thing isn't for performance (not directly), it's for being
able to compile some D programs on computers with less memory.
I've had machines with 1 or 2 GB of memory on them, wanted to
compile a D program, DMD ran out of memory, and the compiler
crashed. You can maybe start swapping on disk, but that won't be
too great.