On August 28, 2017 at 7:26 AM Michael Meeks <michael.meeks@collabora.com> wrote:
Not entirely convinced here - -but- I expect that dropping one
indirection eg.
typedef std::vector<block> blocks_type;
rather than that extra indirection should significantly improve cache
locality for iteration.
Funny you should mention that, because I was thinking of exactly the same thing after I posted my
reply earlier.
Kohei - does having that extra indirection help with the implementation
of iterators ?
No, not really. I believe I initially did that to make the block movement operation as cheap as
just moving the pointer value. I was especially thinking of moving blocks from one container to
another. But since that struct is so small, making it a non-pointer and storing their states
directly in std::vector will (as you say) improve the locality of whatever is stored therein
without sacrificing the block swapping operations, and it should in theory give us better runtime
performance in all the other operations.
I assume that transferring the mp_data pointer as well as
the size is much the same as transferring a block* ?
Yup. You and I are in agreement here. But if I can propose one thing, let's do that change
separately (or maybe do that first before the other change) just to make things easier to track.
Kohei
--
Kohei Yoshida, LibreOffice Calc hacker
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.