[ooo-build-commit] patches/dev300

Kohei Yoshida kohei at kemper.freedesktop.org
Tue Jun 9 21:46:45 PDT 2009


 patches/dev300/apply                           |    3 +
 patches/dev300/calc-less-formula-progress.diff |   48 +++++++++++++++++++++++++
 2 files changed, 51 insertions(+)

New commits:
commit 667516cdafebf7953fcdcde038d38cfda7214111
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Jun 10 00:42:50 2009 -0400

    Update progress bar less frequently during formula calculation.
    
    This patch is from Caolan.  BTW the performance win is amazing
    given such a simple change. (i#102566)
    
    * patches/dev300/apply:
    * patches/dev300/calc-less-formula-progress.diff:

diff --git a/patches/dev300/apply b/patches/dev300/apply
index c88f337..bc6bd2b 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -2015,6 +2015,9 @@ calc-selection-fixed-cursor.diff,     n#502717, kohei
 # show cursor in non-active panes, instead of ugly black box.
 calc-cursor-split-view.diff, n#433834, kohei
 
+# update progress bar less frequently during formula calculation.
+calc-less-formula-progress.diff, i#102566, kohei
+
 [ OOXML ]
 oox-import-zoom-setting-with-tab-color.diff, n#494603, janneke
 
diff --git a/patches/dev300/calc-less-formula-progress.diff b/patches/dev300/calc-less-formula-progress.diff
new file mode 100644
index 0000000..b74b05e
--- /dev/null
+++ b/patches/dev300/calc-less-formula-progress.diff
@@ -0,0 +1,48 @@
+diff --git sc/inc/progress.hxx sc/inc/progress.hxx
+index 0e7f545..7e9bb7c 100644
+--- sc/inc/progress.hxx
++++ sc/inc/progress.hxx
+@@ -36,6 +36,17 @@
+ 
+ class ScDocument;
+ 
++/*
++ * #i102566
++ * Drawing a progress bar update is not cheap, so if we draw it on every
++ * percentage change of 200 calculations we get one progress draw per 2
++ * calculations which is slower than doing the calculations themselves. So as a
++ * rough guide only do an update per MIN_NO_CODES_PER_PROGRESS_UPDATE
++ * calculations
++ */
++#define MIN_NO_CODES_PER_PROGRESS_UPDATE 100
++
++
+ class SC_DLLPUBLIC ScProgress
+ {
+ private:
+diff --git sc/source/core/data/cell.cxx sc/source/core/data/cell.cxx
+index cb9cf80..7e5f291 100644
+--- sc/source/core/data/cell.cxx
++++ sc/source/core/data/cell.cxx
+@@ -1724,7 +1724,7 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
+ 
+         // Reschedule verlangsamt das ganze erheblich, nur bei Prozentaenderung ausfuehren
+         ScProgress::GetInterpretProgress()->SetStateCountDownOnPercent(
+-            pDocument->GetFormulaCodeInTree() );
++            pDocument->GetFormulaCodeInTree()/MIN_NO_CODES_PER_PROGRESS_UPDATE );
+ 
+         switch (p->GetVolatileType())
+         {
+diff --git sc/source/core/tool/progress.cxx sc/source/core/tool/progress.cxx
+index 66e1391..3d0e62c 100644
+--- sc/source/core/tool/progress.cxx
++++ sc/source/core/tool/progress.cxx
+@@ -162,7 +162,7 @@ void ScProgress::CreateInterpretProgress( ScDocument* pDoc, BOOL bWait )
+             if ( !pGlobalProgress )
+                 pInterpretProgress = new ScProgress( pDoc->GetDocumentShell(),
+                     ScGlobal::GetRscString( STR_PROGRESS_CALCULATING ),
+-                    pDoc->GetFormulaCodeInTree(), FALSE, bWait );
++                    pDoc->GetFormulaCodeInTree()/MIN_NO_CODES_PER_PROGRESS_UPDATE, FALSE, bWait );
+             pInterpretDoc = pDoc;
+         }
+     }


More information about the ooo-build-commit mailing list