[Pkg-javascript-commits] [node-acorn-jsx] 18/484: Extend benchmark page

Bastien Roucariès rouca at moszumanska.debian.org
Sat Aug 19 14:19:57 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-acorn-jsx.

commit b39c337694aabd3ac9cbd09fe40f3042a71c2887
Author: Marijn Haverbeke <marijnh at gmail.com>
Date:   Tue Oct 2 17:32:00 2012 +0200

    Extend benchmark page
---
 test/bench.html | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/test/bench.html b/test/bench.html
index 064ce4c..fb42472 100644
--- a/test/bench.html
+++ b/test/bench.html
@@ -10,15 +10,27 @@
   <style>
     td { text-align: right; padding-right: 20px; }
     th { text-align: left; padding-right: 40px; }
+    body { max-width: 50em; padding: 1em 2em; }
+    h1 { font-size: 150%; }
   </style>
 </head>
 
 <h1>Acorn/Esprima/UglifyJS speed comparison</h1>
 
-<p>This will run three parsers on the source code of jQuery 1.6.4 and CodeMirror 3.0b1, and show the number of lines parsed per second for each of the parsers in a table.<p>
+<p>This will run each of the three parsers on the source code of
+jQuery 1.6.4 and CodeMirror 3.0b1 for two seconds, and show a table
+indicating the number of lines parsed per second. Note that UglifyJS
+always stores location data, and is thus not fairly compared by the
+benchmark <em>without</em> location data.<p>
 
-<button onclick="run(false)">Compare without location data</button>
-<button onclick="run(true)">Compare with location data</button>
+<p>Also note that having the developer tools open in Chrome, or
+Firebug in Firefox <em>heavily</em> influences the numbers you get. In
+Chrome, the effect even lingers (in the tab) after you close the
+developer tools. Load in a fresh tab to get (halfway) stable
+numbers.</p>
+
+<button onclick="run(false)">Compare <strong>without</strong> location data</button>
+<button onclick="run(true)">Compare <strong>with</strong> location data</button>
 <span id="running"></span>
 
 <script>
@@ -59,7 +71,7 @@
 
   function run(locations) {
     var running = document.getElementById("running");
-    running.innerHTML = "(Running...)";
+    running.innerHTML = "Running benchmark...";
     var data = [{name: "Acorn", runner: runAcorn},
                 {name: "Esprima", runner: runEsprima},
                 {name: "UglifyJS", runner: runUglifyJS}];

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-acorn-jsx.git



More information about the Pkg-javascript-commits mailing list