Hacker News new | ask | show | jobs
by atilaneves 1937 days 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.

1 comments

I 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.