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

What is special about msvc's `std::deque`?


The memory chunks it allocates to store entries are so small that it ends up allocating one chunk for every element for almost every type. The result is a lot of allocation overhead, pointer indirection and various other things that are bad for performance.


It's block size is something stupid like 16 bytes, so it effectively becomes a slower linked list.


See https://devblogs.microsoft.com/oldnewthing/20230810-00/?p=10... which includes confirmation & a brief commentary of the tiny block size.




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

Search: