[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - sw/source

Ashod Nakashian ashodnakashian at yahoo.com
Thu Feb 26 08:02:44 PST 2015


 sw/source/core/doc/DocumentStatisticsManager.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 2304bce084a87cdf2e0711f8408b53036f1d5d37
Author: Ashod Nakashian <ashodnakashian at yahoo.com>
Date:   Sat Feb 21 19:07:37 2015 -0500

    tdf#38837 Reduce power consumption by minimizing idle timers
    
    Based on profiling, Writer's most CPU consuming idle event was
    document statistics calculation.
    This patch stops the idle timer once statistics has been updated.
    Subsequent profiling shows a sharp decline in CPU usage.
    
    Modifications to the document should initiate statistics update.
    
    Change-Id: I8c38ad8847987264549945e4f482ea18d2635283
    Reviewed-on: https://gerrit.libreoffice.org/14575
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit c57213764b387dddad946e78145cea607ca9f460)
    Signed-off-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/source/core/doc/DocumentStatisticsManager.cxx b/sw/source/core/doc/DocumentStatisticsManager.cxx
index 5017630..843c988 100644
--- a/sw/source/core/doc/DocumentStatisticsManager.cxx
+++ b/sw/source/core/doc/DocumentStatisticsManager.cxx
@@ -123,6 +123,8 @@ void DocumentStatisticsManager::UpdateDocStat( bool bCompleteAsync, bool bFields
         }
         else if (IncrementalDocStatCalculate(5000, bFields))
             maStatsUpdateTimer.Start();
+        else
+            maStatsUpdateTimer.Stop();
     }
 }
 
@@ -223,7 +225,7 @@ bool DocumentStatisticsManager::IncrementalDocStatCalculate(long nChars, bool bF
         pType->UpdateFlds();
     }
 
-    return nChars <= 0;
+    return nChars < 0;
 }
 
 IMPL_LINK( DocumentStatisticsManager, DoIdleStatsUpdate, Timer *, pTimer )


More information about the Libreoffice-commits mailing list