Title: [147514] trunk/Source/_javascript_Core
Revision
147514
Author
[email protected]
Date
2013-04-02 18:41:16 -0700 (Tue, 02 Apr 2013)

Log Message

DFG should compile a little sooner
https://bugs.webkit.org/show_bug.cgi?id=113835

Unreviewed.

Rolled out r147511 because it was based on incorrect performance
measurement.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::optimizationThresholdScalingFactor):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (147513 => 147514)


--- trunk/Source/_javascript_Core/ChangeLog	2013-04-03 01:32:24 UTC (rev 147513)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-04-03 01:41:16 UTC (rev 147514)
@@ -3,6 +3,19 @@
         DFG should compile a little sooner
         https://bugs.webkit.org/show_bug.cgi?id=113835
 
+        Unreviewed.
+
+        Rolled out r147511 because it was based on incorrect performance
+        measurement.
+
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::optimizationThresholdScalingFactor):
+
+2013-04-02  Geoffrey Garen  <[email protected]>
+
+        DFG should compile a little sooner
+        https://bugs.webkit.org/show_bug.cgi?id=113835
+
         Reviewed by Michael Saboff.
 
         2% speedup on SunSpider.

Modified: trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp (147513 => 147514)


--- trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp	2013-04-03 01:32:24 UTC (rev 147513)
+++ trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp	2013-04-03 01:41:16 UTC (rev 147514)
@@ -2937,7 +2937,7 @@
 
 double CodeBlock::optimizationThresholdScalingFactor()
 {
-    // This _expression_ originally arose from doing a least-squares fit of
+    // This _expression_ arises from doing a least-squares fit of
     //
     // F[x_] =: a * Sqrt[x + b] + Abs[c * x] + d
     //
@@ -2951,13 +2951,8 @@
     //  4000       5.5          (random large size, used to cause the function to converge to a shallow curve of some sort)
     // 10000       6.0          (similar to above)
     //
-    // Since then, as compile times have gone down and optimization value has gone up, we've
-    // tweaked the function to favor earlier compilation.
+    // I achieve the minimization using the following Mathematica code:
     //
-    // What follows is a complete description of how to reproduce the original coefficients:
-    //
-    // I achieved the minimization using the following Mathematica code:
-    //
     // MyFunctionTemplate[x_, a_, b_, c_, d_] := a*Sqrt[x + b] + Abs[c*x] + d
     //
     // samples = {{10, 0.9}, {200, 1}, {320, 1.2}, {1268, 5}, {4000, 5.5}, {10000, 6}}
@@ -2996,23 +2991,21 @@
     // the function turning over and going negative for large x) and I threw in a Sqrt
     // term because Sqrt represents my intution that the function should be more sensitive
     // to small changes in small values of x, but less sensitive when x gets large.
-    //
+    
     // Note that the current fit essentially eliminates the linear portion of the
     // _expression_ (c == 0.0).
-
     const double a = 0.061504;
     const double b = 1.02406;
     const double c = 0.0;
     const double d = 0.825914;
-    const double instructionRatio = 0.8;
     
-    double x = instructionCount() * instructionRatio;
+    double instructionCount = this->instructionCount();
     
-    ASSERT(x); // Make sure this is called only after we have an instruction stream; otherwise it'll just return the value of d, which makes no sense.
+    ASSERT(instructionCount); // Make sure this is called only after we have an instruction stream; otherwise it'll just return the value of d, which makes no sense.
     
-    double result = d + a * sqrt(x + b) + c * x;
+    double result = d + a * sqrt(instructionCount + b) + c * instructionCount;
 #if ENABLE(JIT_VERBOSE_OSR)
-    dataLog(*this, ": instruction count is ", instructionCount(), ", scaling execution counter by ", result, " * ", codeTypeThresholdMultiplier(), "\n");
+    dataLog(*this, ": instruction count is ", instructionCount, ", scaling execution counter by ", result, " * ", codeTypeThresholdMultiplier(), "\n");
 #endif
     return result * codeTypeThresholdMultiplier();
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to