5 ms·
> I am not sure about D, but Go also uses escape analysis so that data structures are allocated on the stack instead of the heap when possible which can help to
by destructionator 6y ago
> I am not sure about D, but Go also uses escape analysis so that data structures are allocated on the stack instead of the heap when possible which can help to reduce garbage and hence memory usage.
D sometimes does this but for the most part it depends on how you write the code. strings, large arrays, and class objects are typically GC'd but struct instances and small arrays are often not.
The code in the blog post appears to mostly use small stack memory.
The only weird thing i see in the blog post is 30 second compile. Yikes, this should be more like 3 second from scratch, max - it must use some heavier-than-necessary dependencies.
- Doxin 6y agoIt seems to include botan, which is a fairly large C++ library. You can be assured that by far most of those 30 seconds are linking. The compile step itself for D is going to be done in <1s for the code shown.