4 ms·
The principle is a combination of pragmatism, pain, and then realisation that all memory allocation is slow (allocate less memory). Lots of D code is fundament
by mhh__ 6y ago
The principle is a combination of pragmatism, pain, and then realisation that all memory allocation is slow (allocate less memory).
Lots of D code is fundamentally lazy.
- WalterBright 6y agoThe fastest memory allocator is no-allocation allocation. D has some cool methods for doing that, like the chain template and voldemort types. For example, chain can be used to "concatenate" two arrays without allocating a byte. https://dlang.org/phobos/std_range.html#chain https://dlang.org/phobos/std_range.html#chain https://wiki.dlang.org/Voldemort_types https://wiki.dlang.org/Voldemort_types