[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sw/source
Michael Stahl (via logerrit)
logerrit at kemper.freedesktop.org
Sun May 2 08:18:28 UTC 2021
sw/source/core/txtnode/txtedt.cxx | 8 ++++++++
1 file changed, 8 insertions(+)
New commits:
commit f85ed126774a06643e5529c799cd60489984c32c
Author: Michael Stahl <michael.stahl at allotropia.de>
AuthorDate: Fri Apr 30 15:31:54 2021 +0200
Commit: Thorsten Behrens <thorsten.behrens at allotropia.de>
CommitDate: Sun May 2 10:17:54 2021 +0200
sw: speed up DoIdleJobs(WORD_COUNT)
SwTextNode::CountWords() has early returns that don't clear the
WordCountDirty flag, for nodes that don't contain any plain text.
This speeds things up considerably for tdf135116-1.odt, which didn't
finish the idle jobs after 5 minutes in an optimized 7.1 build, because
the time slice tends to expire iterating nodes in word-count before it
can make progress.
With this it does ~25 WORD_COUNT pages and then ~90 AUTOCOMPLETE_WORDS
pages per idle, sending OnLayoutFinished after 13-14 seconds.
jmux just pointed me to commit 0fedac18214a6025401c4c426466a5166553e8ec
which is not in 7.1 today and may have improved the performance here.
Change-Id: I5e9651da3a173649c49fc36edefb23298dfd6bc4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114936
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
(cherry picked from commit 4184569b963877c2a488ff05766654b9db194798)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114919
Reviewed-by: Thorsten Behrens <thorsten.behrens at allotropia.de>
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index cc66f68ed23e..61e1101fb330 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -2022,6 +2022,10 @@ bool SwTextNode::CountWords( SwDocStat& rStat,
if( nStt == nEnd && !bCountNumbering)
{ // unnumbered empty node or empty selection
+ if (bCountAll)
+ {
+ SetWordCountDirty( false ); // reset flag to speed up DoIdleJob
+ }
return false;
}
@@ -2050,6 +2054,10 @@ bool SwTextNode::CountWords( SwDocStat& rStat,
if (aExpandText.isEmpty() && !bCountNumbering)
{
+ if (bCountAll)
+ {
+ SetWordCountDirty( false ); // reset flag to speed up DoIdleJob
+ }
return false;
}
More information about the Libreoffice-commits
mailing list