|
|
|
|
|
by sprw121
4068 days ago
|
|
Thanks for responding. I've seen this code used an an example before actually. Not that buffer reuse/avoiding heap allocations was unknown to me, it was just surprising to see this in an application that spent most of it's time waiting on the network. I will say as a positive point that the equivalent D code to a C++ implementation was much cleaner due to build in array slicing among other things. There are other areas where heap allocations are not so avoidable however (some hashmaps, some std's). My main point is that like at all languages, heap allocations are slow, but here they bear an unnecessarily large contention factor. I really like D so I hope this is helpful feedback. |
|