| D is a awesome language to work with, it's got many useful language features that make the activity of code writing a pleasure. - I hope this criticism is taking constructively. However not a beat a dead horse, but if you want to process more than a trickle of data in it you run into problems with the GC really quickly. I really feel the language would be better off without the GC. These are not the same issues address by the JSON compiler post or w/e that surfaces a couple months ago. From what I can tell, theres a global lock around everything in the GC, including allocations. In a multi-core world, this just simply doesn't work and it one of the major pain point of the language. I write data-intensive processing on high core count machines (32), and have had to resort to 0-allocation strategies, or in map-reduce contexts actually sharding at the process level, writing the results to disk, and then running a reducer process over the results. You can write performant D code, but you give up large amounts of code safety. It's essentially just whatever you'd write in C++ without the ownership semantics it gives you. You can't have a core part of your language being an essentially unavoidable massive point of contention. I've literally seen 20x or more speedups in multithreaded cases just by making sure I reuse every buffer rather than create new ones. I feel this is really holding back an otherwise great language to work in. This is discussed in the reddit thread in more detail. |
Reuse rather than free and reallocate is a core practice whenever you feel the need for speed, regardless of the memory allocate strategy used.
For some very fast D code:
https://github.com/facebook/warp
Minimizing the amount of heap memory allocated is a core strategy.