DFG compile time measurements should really report milliseconds
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Mar 2015 04:33:28 +0000 (04:33 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Mar 2015 04:33:28 +0000 (04:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=142209

Reviewed by Benjamin Poulain.

Source/JavaScriptCore:

Fix this to record milliseconds instead of seconds.

* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::compileInThread):
(JSC::DFG::Plan::compileInThreadImpl):

Source/WTF:

This bug was introduced because currentTimeMS() calls were converted to
monotonicallyIncreasingTime() calls. Perhaps this bug would be less likely if there was a
monotonicallyIncreasingTimeMS() function available, so this patch adds it.

* wtf/CurrentTime.h:
(WTF::monotonicallyIncreasingTimeMS):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180919 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/dfg/DFGPlan.cpp
Source/WTF/ChangeLog
Source/WTF/wtf/CurrentTime.h

index ef24b99..b40a586 100644 (file)
@@ -1,5 +1,18 @@
 2015-03-02  Filip Pizlo  <fpizlo@apple.com>
 
+        DFG compile time measurements should really report milliseconds
+        https://bugs.webkit.org/show_bug.cgi?id=142209
+
+        Reviewed by Benjamin Poulain.
+        
+        Fix this to record milliseconds instead of seconds.
+
+        * dfg/DFGPlan.cpp:
+        (JSC::DFG::Plan::compileInThread):
+        (JSC::DFG::Plan::compileInThreadImpl):
+
+2015-03-02  Filip Pizlo  <fpizlo@apple.com>
+
         Remove op_get_callee, it's unused
         https://bugs.webkit.org/show_bug.cgi?id=142206
 
index f61fefc..fbc1ae2 100644 (file)
@@ -151,7 +151,7 @@ void Plan::compileInThread(LongLivedState& longLivedState, ThreadData* threadDat
     double before = 0;
     CString codeBlockName;
     if (reportCompileTimes()) {
-        before = monotonicallyIncreasingTime();
+        before = monotonicallyIncreasingTimeMS();
         codeBlockName = toCString(*codeBlock);
     }
     
@@ -188,7 +188,7 @@ void Plan::compileInThread(LongLivedState& longLivedState, ThreadData* threadDat
 #endif
             break;
         }
-        double now = monotonicallyIncreasingTime();
+        double now = monotonicallyIncreasingTimeMS();
         dataLog("Optimized ", codeBlockName, " using ", mode, " with ", pathName, " into ", finalizer ? finalizer->codeSize() : 0, " bytes in ", now - before, " ms");
         if (path == FTLPath)
             dataLog(" (DFG: ", m_timeBeforeFTL - before, ", LLVM: ", now - m_timeBeforeFTL, ")");
@@ -389,7 +389,7 @@ Plan::CompilationPath Plan::compileInThreadImpl(LongLivedState& longLivedState)
         FTL::lowerDFGToLLVM(state);
         
         if (reportCompileTimes())
-            m_timeBeforeFTL = monotonicallyIncreasingTime();
+            m_timeBeforeFTL = monotonicallyIncreasingTimeMS();
         
         if (Options::llvmAlwaysFailsBeforeCompile()) {
             FTL::fail(state);
index 249f08e..3d3b946 100644 (file)
@@ -1,3 +1,17 @@
+2015-03-02  Filip Pizlo  <fpizlo@apple.com>
+
+        DFG compile time measurements should really report milliseconds
+        https://bugs.webkit.org/show_bug.cgi?id=142209
+
+        Reviewed by Benjamin Poulain.
+        
+        This bug was introduced because currentTimeMS() calls were converted to
+        monotonicallyIncreasingTime() calls. Perhaps this bug would be less likely if there was a
+        monotonicallyIncreasingTimeMS() function available, so this patch adds it.
+
+        * wtf/CurrentTime.h:
+        (WTF::monotonicallyIncreasingTimeMS):
+
 2015-02-27  Darin Adler  <darin@apple.com>
 
         Remove unused PossiblyNull
index 3d764a9..7a90569 100644 (file)
@@ -56,6 +56,11 @@ inline double currentTimeMS()
 // NTP or manual adjustments, so it is better suited for elapsed time measurement.
 WTF_EXPORT_PRIVATE double monotonicallyIncreasingTime();
 
+inline double monotonicallyIncreasingTimeMS()
+{
+    return monotonicallyIncreasingTime() * 1000.0;
+}
+
 // Returns the current CPU time of the current thread.
 // Precision varies depending on platform but is usually as good or better
 // than a millisecond.
@@ -66,6 +71,7 @@ WTF_EXPORT_PRIVATE std::chrono::microseconds currentCPUTime();
 using WTF::currentTime;
 using WTF::currentTimeMS;
 using WTF::monotonicallyIncreasingTime;
+using WTF::monotonicallyIncreasingTimeMS;
 using WTF::currentCPUTime;
 
 #endif // CurrentTime_h