summaryrefslogtreecommitdiff
path: root/include/svl
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2020-06-26 08:48:55 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-06-26 12:00:15 +0200
commitb0e0ba28dcb69b6d042107f24c961b444eb6793e (patch)
tree964e18e0796f2019165cf3d81a6cf3466752bd81 /include/svl
parentda527cd45b9676c9d1d8eb171ecbe55e8b8f9031 (diff)
optimize SvtBroadcaster::Normalize() even a bit more (tdf#132454)
Optimize also maDestructedListeners (often just one item). Optimize also small vectors if there's just one item unsorted. Keep the index of the first unsorted item in maListeners, so that it's cheap to find out where the unsorted part starts. This now improves tdf#132454 to 20s. Change-Id: I21a69b440c27a2e31e74fd13b9263f54af12e320 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97198 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/svl')
-rw-r--r--include/svl/broadcast.hxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/svl/broadcast.hxx b/include/svl/broadcast.hxx
index b4c8be5f9ac0..6569775b68d4 100644
--- a/include/svl/broadcast.hxx
+++ b/include/svl/broadcast.hxx
@@ -83,8 +83,10 @@ private:
/// Indicate that this broadcaster will be destructed (we indicate this on all ScColumn's broadcasters during the ScTable destruction, eg.)
bool mbAboutToDie:1;
bool mbDisposing:1;
- mutable bool mbNormalized:1;
+ // Whether maDestructedListeners is sorted or not.
mutable bool mbDestNormalized:1;
+ // The first item in maListeners that is not sorted. The container can become large, so this optimizes sorting.
+ mutable size_t mnListenersFirstUnsorted;
};