[calligra] words/part: Speedup by disabling temporaty sanity check
Thorsten Zachmann
t.zachmann at zagge.de
Sun May 8 05:58:59 BST 2011
Git commit 9215a05a87ba8d1d9948c354a9b31ec9438b8690 by Thorsten Zachmann.
Committed on 08/05/2011 at 06:52.
Pushed by zachmann into branch 'master'.
Speedup by disabling temporaty sanity check
The sanity check slows down loading document > 100 pages.
It is very very very very slow for document that have more then > 400 pages
Instead of over a minute for layouting it is not done in 4 seconds for the 800 pages ODF spec.
During my tests I only found one document triggering an assert inside the sanity check.
It can be downloaded from
http://www.zagge.de/anchor/110407/www.k12.wa.us%252Fbulletinsmemos%252Fbulletins2%253011%252FB%2530%25301-11AttachE.doc
CCMAIL: calligra-devel at kde.org
CCMAIL: sebastian.sauer at kdab.com
M +5 -0 words/part/KWRootAreaProvider.cpp
http://commits.kde.org/calligra/9215a05a87ba8d1d9948c354a9b31ec9438b8690
diff --git a/words/part/KWRootAreaProvider.cpp b/words/part/KWRootAreaProvider.cpp
index 2c33bca..c45ed6e 100755
--- a/words/part/KWRootAreaProvider.cpp
+++ b/words/part/KWRootAreaProvider.cpp
@@ -288,6 +288,10 @@ void KWRootAreaProvider::doPostLayout(KoTextLayoutRootArea *rootArea, bool isNew
updateRect |= rootArea->associatedShape()->outlineRect();
rootArea->associatedShape()->update(updateRect);
+#if 0
+ // enabling this makes loading documents > 100 pages much much slower
+ // for documents > 400 it gets so slow that it is barly useable.
+ // only enable if you know what you are doing and never commit it enabled
// temporary sanity-check
for(int i = 1; i <= pageManager->pageCount(); ++i) {
KWPage page = pageManager->page(i);
@@ -345,6 +349,7 @@ void KWRootAreaProvider::doPostLayout(KoTextLayoutRootArea *rootArea, bool isNew
Q_ASSERT(!evenFooterFrame || evenFooterFrame->shape() == evenFooterArea->associatedShape());
}
}
+#endif
if (m_textFrameSet->textFrameSetType() == KWord::MainTextFrameSet) {
handleDependentProviders(page.pageNumber());
More information about the calligra-devel
mailing list