4 ms·
8 bytes??? Are you sure you don't mean 8 * sizeof(class)? That's just ridiculous. Regardless it would be nice if one could specify the block size as an argumen
by svantana 8y ago
8 bytes??? Are you sure you don't mean 8 * sizeof(class)? That's just ridiculous.
Regardless it would be nice if one could specify the block size as an argument. I suppose I could write my own allocator, but it's just too much hassle for such a simple thing as storage.
- rwbt 8y agoIf I remember correctly, in MSVC implementation if sizeof(T) is greater than 8 bytes then each 'block' is just one element (also blocks aren't contiguous). So effectively, MSVC implementation is useless. Boost does have a a deque container where you can specify the block size using type traits, but from my experience boost's deque wasn't such a good implementation performance wise. But Clang's libc++ implementation is very good performance wise and even beat std::vector in some cases.
- s3cur3 8y agoWorse, this is not on the table to be fixed any time soon in MSVC, because the change would break ABI compatibility. Every time someone says "just use a custom allocator," I sigh inside... it's so much overhead that almost no one does it, and even fewer do it correctly. :(