summaryrefslogtreecommitdiff
path: root/benchmark/util/inspect.js
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark/util/inspect.js')
-rw-r--r--benchmark/util/inspect.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/benchmark/util/inspect.js b/benchmark/util/inspect.js
new file mode 100644
index 0000000000..8a59e6b48e
--- /dev/null
+++ b/benchmark/util/inspect.js
@@ -0,0 +1,15 @@
+var util = require('util');
+
+var common = require('../common.js');
+
+var bench = common.createBenchmark(main, {n: [5e6]});
+
+function main(conf) {
+ var n = conf.n | 0;
+
+ bench.start();
+ for (var i = 0; i < n; i += 1) {
+ var r = util.inspect({a: 'a', b: 'b', c: 'c', d: 'd'});
+ }
+ bench.end(n);
+}