Bug 786789 - Optimize TimeDuration::ToSeconds on Windows to avoid blocked store forwards; r=ehsan
authorJoe Olivas <joseph.k.olivas@intel.com>
Wed, 29 Aug 2012 21:09:01 -0400
changeset 103847 5502417dfd4e127f5de27e3a22857fd7af8ebb1e
parent 103846 3eb0de1d8c3b65ece6f7527ca8ea2c01ea10392c
child 103848 af0b960c0418287905353b654cc09f6f3bf1c5fc
push id14198
push usereakhgari@mozilla.com
push dateThu, 30 Aug 2012 01:09:05 +0000
treeherdermozilla-inbound@5502417dfd4e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs786789
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 786789 - Optimize TimeDuration::ToSeconds on Windows to avoid blocked store forwards; r=ehsan
xpcom/ds/TimeStamp_windows.cpp
--- a/xpcom/ds/TimeStamp_windows.cpp
+++ b/xpcom/ds/TimeStamp_windows.cpp
@@ -523,17 +523,18 @@ CalibratedPerformanceCounter()
 
 // ----------------------------------------------------------------------------
 // TimeDuration and TimeStamp implementation
 // ----------------------------------------------------------------------------
 
 double
 TimeDuration::ToSeconds() const
 {
-  return double(mValue) / (sFrequencyPerSec * 1000ULL);
+  // Converting before arithmetic avoids blocked store forward
+  return double(mValue) / (double(sFrequencyPerSec) * 1000.0);
 }
 
 double
 TimeDuration::ToSecondsSigDigits() const
 {
   AutoCriticalSection lock(&sTimeStampLock);
 
   // don't report a value < mResolution ...