> On August 28, 2017 at 7:26 AM Michael Meeks <[email protected]> 
> 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
_______________________________________________
LibreOffice mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to