[Libreoffice] [PATCH] Replaced tools/list with std::vector in funcdesc.hxx / funcdesc.cxx

Soeren Moeller soerenmoeller2001 at gmail.com
Fri Jan 28 13:14:31 PST 2011

Yet another patch, removing use of tools/list from ScFunctionList,
too. In this class there should be a clear performance gain, by using
a vector instead of a list, as our tests revealed that the random
access Get() function is called 2-3000 times for each use of a
spreadsheet function. Note that we use a std::list for constructing
the object, as the number of elements is unknown while constructing,
but then convert the list to a vector at the end of the construction,
to make efficient random access possible.

With this patch (together with our last patch)
funcdesc.hxx/funcdesc.cxx shouldn't use tools/list anymore, so we have
removed the includes.
The patch compiles fine here, and scalc seems to work as expected.

Sören Möller

2011/1/28 Soeren Moeller <soerenmoeller2001 at gmail.com>:
> Hi
> In the attached patches (0001 is the real patch, 0002 contains three
> comments missing in 0001) we have replaced use of tools/list by use of
> std::vector in ScFunctionMgr and ScFunctionCategory (in
> sc/inc/funcdesc.hxx and sc/source/core/funcdesc.cxx). We choose
> vector, as there is done random access to the lists, while they are
> only modified once (at creation). We changed the behaviour of
> ScFunctionMgr slightly, as Get() now no longer resets the iterators
> for First() and Next(), as this is quite counter intuitive. The patch
> builds fine, and the behaviour of scalc seems unchanged.
> The patch is joint work with Thies Pierdola, who is marked as author
> in the patch file.
> Regards
> Sören Möller
> (LGPLv3+/MPL for this and future patches)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Replaced-tools-list-by-std-vector-in-ScFunctionList.patch
Type: text/x-patch
Size: 5957 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110128/6f9a5ecd/attachment.bin>

More information about the LibreOffice mailing list