Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2013-02-12 10:54:27 +0400
committerisaacs <i@izs.me>2013-02-20 02:14:34 +0400
commit7e5cd08061dc17f38dec307ae8fc43e44b85a777 (patch)
treee1e31e4d6d4730e7db08f0709944a1be04d52aa4 /benchmark
parentf7a4ccb409c14fed9c52956765c95b10bacb779a (diff)
bench: move next-tick to misc/next-tick-breadth
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/misc/next-tick-breadth.js21
-rw-r--r--benchmark/next-tick.js17
2 files changed, 21 insertions, 17 deletions
diff --git a/benchmark/misc/next-tick-breadth.js b/benchmark/misc/next-tick-breadth.js
new file mode 100644
index 00000000000..65240814437
--- /dev/null
+++ b/benchmark/misc/next-tick-breadth.js
@@ -0,0 +1,21 @@
+
+var common = require('../common.js');
+var bench = common.createBenchmark(main, {
+ millions: [2]
+});
+
+function main(conf) {
+ var N = +conf.millions * 1e6;
+ var n = 0;
+
+ function cb() {
+ n++;
+ if (n === N)
+ bench.end(n / 1e6);
+ }
+
+ bench.start();
+ for (var i = 0; i < N; i++) {
+ process.nextTick(cb);
+ }
+}
diff --git a/benchmark/next-tick.js b/benchmark/next-tick.js
deleted file mode 100644
index 9352f8dc0a9..00000000000
--- a/benchmark/next-tick.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// run with `time node benchmark/next-tick.js`
-var assert = require('assert');
-
-var N = 1e7;
-var n = 0;
-
-process.on('exit', function() {
- assert.equal(n, N);
-});
-
-function cb() {
- n++;
-}
-
-for (var i = 0; i < N; ++i) {
- process.nextTick(cb);
-}