Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: