tdf#109097 - mdds accelerating random lookups

Kohei Yoshida libreoffice at kohei.us
Mon Aug 28 12:24:08 UTC 2017


> On August 28, 2017 at 7:26 AM Michael Meeks <michael.meeks at 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


More information about the LibreOffice mailing list