[Pkg-javascript-commits] [node-leveldown] 81/492: added focus-arrow to benchmark suite

Andrew Kelley andrewrk-guest at moszumanska.debian.org
Sun Jul 6 17:13:47 UTC 2014


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

andrewrk-guest pushed a commit to annotated tag rocksdb-0.10.1
in repository node-leveldown.

commit 6549f1cb3baea6511b15fdfd645a622a4767f963
Author: Rod Vagg <rod at vagg.org>
Date:   Mon Nov 19 11:18:44 2012 +1100

    added focus-arrow to benchmark suite
---
 test/benchmarks/README.md | 4 +++-
 test/benchmarks/index.js  | 8 ++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/test/benchmarks/README.md b/test/benchmarks/README.md
index 08c4acf..c47778c 100644
--- a/test/benchmarks/README.md
+++ b/test/benchmarks/README.md
@@ -4,4 +4,6 @@ Set up by running `npm install` in this directory.
 
 Run with `node ./`.
 
-Edit *benchmarks.js* to add more benchmarks to the suite.
\ No newline at end of file
+Edit *benchmarks.js* to add more benchmarks to the suite.
+
+To run a **single benchmark**, put a "focus arrow" at the beginning of the name: `'=>name': function (db, cb) {}` and the rest will be ignored.
\ No newline at end of file
diff --git a/test/benchmarks/index.js b/test/benchmarks/index.js
index c09044f..48826b9 100644
--- a/test/benchmarks/index.js
+++ b/test/benchmarks/index.js
@@ -44,6 +44,14 @@ var Benchmark = require('benchmark')
       })
     }
 
+  , focusKey = Object.keys(benchmarks).filter(function (k) { return (/\=>/).test(k) })
+
+if (focusKey.length) {
+  var focusBenchmark = benchmarks[focusKey[0]]
+  benchmarks = {}
+  benchmarks[focusKey[0]] = focusBenchmark
+}
+
 async.forEachSeries(
     Object.keys(benchmarks)
   , function (name, cb) {

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



More information about the Pkg-javascript-commits mailing list