On 2015-09-28 03:11 PM, Markus Mohrhard wrote:
I'm not sure if I understand your comment. Can you please clarify what you mean with that? Maybe my
understanding of our
memory allocators is bad but I see not how this comment applies to the discussion.
I'm saying that in general I regard changing allocators as doing optimisation in the wrong place - if your allocator is
a real bottle-neck, you would probably be better off looking at optimising the code that __calls__ the allocator, rather
than messing with the allocator itself.
For example, if you had code that did:
vector<int> buffer;
for (int i=0; i<1000000000; i++)
buffer.push_back(i);
you'd be better off inserting a
buffer.reserve(1000000000)
just before the loop, to avoid the std::vector's resize-and-copy operation.
But that's just my opinion, feel free to experiment away if allocators are your thing :-)
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.