summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--benchmark/v8/get-stats.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/benchmark/v8/get-stats.js b/benchmark/v8/get-stats.js
new file mode 100644
index 0000000000..34d52d039f
--- /dev/null
+++ b/benchmark/v8/get-stats.js
@@ -0,0 +1,23 @@
+'use strict';
+
+const common = require('../common.js');
+const v8 = require('v8');
+
+const bench = common.createBenchmark(main, {
+ method: [
+ 'getHeapStatistics',
+ 'getHeapSpaceStatistics'
+ ],
+ n: [1e6],
+ flags: ['--ignition --turbo', '']
+});
+
+function main(conf) {
+ const n = +conf.n;
+ const method = conf.method;
+ var i = 0;
+ bench.start();
+ for (; i < n; i++)
+ v8[method]();
+ bench.end(n);
+}