include/svx/svdpage.hxx | 3 ++- svx/source/svdraw/svdpage.cxx | 5 +---- 2 files changed, 3 insertions(+), 5 deletions(-)
New commits: commit 746127cf803070c5a695a7cb30a2ecdb5a777e75 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Jan 4 14:07:13 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Jan 4 16:06:08 2022 +0100 use deque in SdrObjList which has much better performance for (a) inserting stuff at the front (b) appending large numbers of items something that happens when constructing large charts - shaves 5% off the load time for large sample bar chart Change-Id: I3ebccbfdc75e4df3ec88eb2dde46acfe0ab0ae7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127940 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx index 065590e85b9a..83c0592f060e 100644 --- a/include/svx/svdpage.hxx +++ b/include/svx/svdpage.hxx @@ -34,6 +34,7 @@ #include <memory> #include <optional> #include <vector> +#include <deque> // predefines @@ -225,7 +226,7 @@ public: private: tools::Rectangle maSdrObjListOutRect; tools::Rectangle maSdrObjListSnapRect; - std::vector<SdrObject*> maList; + std::deque<SdrObject*> maList; /// This list, if it exists, defines the navigation order. If it does /// not exist then maList defines the navigation order. std::optional<std::vector<tools::WeakReference<SdrObject>>> mxNavigationOrder; diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index 99c6ab9d3185..d4322e3a8720 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -58,8 +58,6 @@ using namespace ::com::sun::star; -const sal_Int32 InitialObjectContainerCapacity (64); - ////////////////////////////////////////////////////////////////////////////// SdrObjList::SdrObjList() @@ -67,7 +65,6 @@ SdrObjList::SdrObjList() mbRectsDirty(false), mbIsNavigationOrderDirty(false) { - maList.reserve(InitialObjectContainerCapacity); } void SdrObjList::impClearSdrObjList(bool bBroadcast) @@ -641,7 +638,7 @@ void SdrObjList::sort( std::vector<sal_Int32>& sortOrder) // example maList [T T S T T] ( T T = shape with textbox, S = just a shape ) // (shapes at positions 0 and 2 have a textbox) - std::vector<SdrObject*> aNewList(maList.size()); + std::deque<SdrObject*> aNewList(maList.size()); std::set<sal_Int32> aShapesWithTextbox; std::vector<sal_Int32> aIncrements; std::vector<sal_Int32> aDuplicates;