3 ms·
This is great! I'd like to quote a line here, because I think the answer is “someone on HN knows” and I'd like to hear the answer as well. > V8 is actually sus
by paulgb 5y ago
This is great! I'd like to quote a line here, because I think the answer is “someone on HN knows” and I'd like to hear the answer as well.
> V8 is actually suspiciously fast at this part, so maybe v8 isn't using an array internally to implement Arrays? Who knows!
- bouk 5y agoThe V8 blog is a good starting point for learning how it works under the hood: https://v8.dev/blog/fast-properties https://v8.dev/blog/fast-properties
- vlovich123 5y agoHmm... I would have thought they implemented something similar to a std::deque so that you have ammortized O(1) insertions into the middle of a vector.