aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-05-25 07:15:55 +0800
committerGitHub <noreply@github.com>2017-05-25 07:15:55 +0800
commit793d61499b4ab53cdfdd3b81b9faf9f36b77bae8 (patch)
treeae3837ea2eb3070a2f0f8ea9fd93d36388a54940 /test
parenta277fe168dede9d61781547ab30adfaf593e6e6e (diff)
downloadtracifyjs-793d61499b4ab53cdfdd3b81b9faf9f36b77bae8.tar.gz
tracifyjs-793d61499b4ab53cdfdd3b81b9faf9f36b77bae8.zip
report timing breakdown (#2000)
fix corner cases with `sourceMap` fixes #1998
Diffstat (limited to 'test')
-rw-r--r--test/benchmark.js9
-rw-r--r--test/jetstream.js2
2 files changed, 3 insertions, 8 deletions
diff --git a/test/benchmark.js b/test/benchmark.js
index d7b0263f..e27ed2c3 100644
--- a/test/benchmark.js
+++ b/test/benchmark.js
@@ -9,7 +9,7 @@ var args = process.argv.slice(2);
if (!args.length) {
args.push("-mc");
}
-args.push("--stats");
+args.push("--timings");
var urls = [
"https://code.jquery.com/jquery-3.2.1.js",
"https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.4/angular.js",
@@ -29,12 +29,7 @@ function done() {
var info = results[url];
console.log();
console.log(url);
- var elapsed = 0;
- console.log(info.log.replace(/Elapsed: ([0-9]+)\s*/g, function(match, time) {
- elapsed += 1e-3 * parseInt(time);
- return "";
- }));
- console.log("Run-time:", elapsed.toFixed(3), "s");
+ console.log(info.log);
console.log("Original:", info.input, "bytes");
console.log("Uglified:", info.output, "bytes");
console.log("SHA1 sum:", info.sha1);
diff --git a/test/jetstream.js b/test/jetstream.js
index 56da7ad8..4f13a281 100644
--- a/test/jetstream.js
+++ b/test/jetstream.js
@@ -14,7 +14,7 @@ if (typeof phantom == "undefined") {
if (!args.length) {
args.push("-mc");
}
- args.push("--stats");
+ args.push("--timings");
var child_process = require("child_process");
try {
require("phantomjs-prebuilt");