Hello William,
On Sat, 2014-05-24 at 14:47 +0200, William Bonnet wrote:
I attach to this bug entry a proposal for a patch which solve this
problem. A call to shrink_to_fit has been added in the resize_block
method. In order to limit the number of call to this method, and wasting
too much time releasing memory, i only call it when its current size is
half of its capacity (real number of element vs number of element
allocated).
So, I would look at this from 2 angles. One is from the angle of the
container itself, which is what you already did. It's a great analysis
and, while we still need to adjust your change to not require C++11 (as
Stephan already pointed out) as well as the non-binding nature of
shrink_to_fit(), the main idea is sound and we should incorporate it
into multi_type_vector's low-level array management.
Another angle is the code that handles subtotals to see if we could do
it differently in a way that would avoid shrinking of the raw level
arrays. Many existing call cites that accesses multi_type_vector are
still optimized for the old, ScBaseCell-based cell storage which may not
work well with the new array-based storage. And the subtotal code may
be just one of those. But this can be done another time. We are slowly
migrating the call sites to have them perform optimally for the new
storage, and it takes some time.
I'll look into incorporating your change to mdds sometime soon.
Thanks again!
Kohei
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.