[unordered] allocators and EBO

Hi James, (Sorry I called you Jeremy in the other post). When the allocator is empty, you should avoid storing them as members in different internal structures, and make the allcator a base class of some of these structures. Thanks -Thorsten

2009/7/15 Thorsten Ottosen <thorsten.ottosen@dezide.com>:
When the allocator is empty, you should avoid storing them as members in different internal structures, and make the allcator a base class of some of these structures.
Hi, Sorry for the late reply. I'm putting together a new version for release in 1.41 or 1.42 which uses EBO and a couple of other changes to reduce the size of the object. It's currently at 28 bytes on my intel mac, a saving of 8 bytes. Although I'm not sure what the performance implications are, so the final version might be a bit bigger. There are another 8 bytes that could be saved at the expense of performance - by removing the pointer to the first non-empty bucket and not storing the maximum load for the current maximum load factor and number of buckets. I'm not really thinking of removing them right now, I might in the future. I'm not using the method you suggested, as I'm wary of it introducing needless padding if the allocators aren't empty, but are very small (1 or 2 bytes). I'm using compressed_pair instead. Daniel

Daniel James skrev:
2009/7/15 Thorsten Ottosen <thorsten.ottosen@dezide.com>:
When the allocator is empty, you should avoid storing them as members in different internal structures, and make the allcator a base class of some of these structures.
Hi,
Sorry for the late reply. I'm putting together a new version for release in 1.41 or 1.42 which uses EBO and a couple of other changes to reduce the size of the object. It's currently at 28 bytes on my intel mac, a saving of 8 bytes. Although I'm not sure what the performance implications are, so the final version might be a bit bigger.
There are another 8 bytes that could be saved at the expense of performance - by removing the pointer to the first non-empty bucket and not storing the maximum load for the current maximum load factor and number of buckets. I'm not really thinking of removing them right now, I might in the future.
I'm not using the method you suggested, as I'm wary of it introducing needless padding if the allocators aren't empty, but are very small (1 or 2 bytes). I'm using compressed_pair instead.
No problem. Thanks -Thorsten
participants (2)
-
Daniel James
-
Thorsten Ottosen