3 ms·
If the array fits in the cache, deleting from the middle of an array and copying all the subsequent elements one to the left is actually faster than a linked li
by atilaneves 6y ago
If the array fits in the cache, deleting from the middle of an array and copying all the subsequent elements one to the left is actually faster than a linked list.
And most arrays fit in the cache.
- cwojno 6y agoI don't think the author was concerned with performance. I was providing the list.* type suggestion to make it easier to delete elements syntactically. However, you're likely right for slices with len < 500 or so due to garbage collector churn on linked lists.