Straight Forward Arrays
Steven Schveighoffer
schveiguy at gmail.com
Mon Oct 2 02:56:33 UTC 2023
On 10/1/23 1:13 PM, dhs wrote:
> It may not be a problem in practice. My concern was performance, because
> each time we add an element to the array, the garbage collector has to
> map the slice to the allocation it belongs to.
FWIW, there is a cache that makes this decently fast, so it doesn't have
to go all the way into the GC to get all the information for every append.
But it *most definitely* not going to be as fast as reading a local
"capacity" variable.
-Steve
More information about the Digitalmars-d-learn
mailing list