diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2020-06-26 08:48:55 +0200 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2020-06-26 17:49:41 +0200 |
commit | 69d476ae67ee4b96e5ff3b8d7a2587644c4af97f (patch) | |
tree | b931f8cc66460827eeaf20675f68ba65d75a40d5 /include | |
parent | c7986b21e9b0a9208ab5bb665d25a5385798207b (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>
(cherry picked from commit b0e0ba28dcb69b6d042107f24c961b444eb6793e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97143
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/svl/broadcast.hxx | 4 |
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; }; |