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:
authorYash Ladha <yashladhapankajladha123@gmail.com>2020-08-09 15:17:51 +0300
committerrickyes <ives199511@gmail.com>2020-08-13 17:33:07 +0300
commit56b25e7a6f741c8181c55f3d40d0cab6ffa1eb4d (patch)
tree7f18403e3a3d1836096626017bb4b3efd8dffae2 /benchmark
parent7a1220a1d745cf2f6d00ed3aa3905b604cea0952 (diff)
benchmark: add benchmark script for resourceUsage
Added a benchmark script for process method to benchmark the method resourceUsage. PR-URL: https://github.com/nodejs/node/pull/34691 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Mary Marchini <oss@mmarchini.me> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/process/resourceUsage.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/benchmark/process/resourceUsage.js b/benchmark/process/resourceUsage.js
new file mode 100644
index 00000000000..83871db680b
--- /dev/null
+++ b/benchmark/process/resourceUsage.js
@@ -0,0 +1,14 @@
+'use strict';
+
+const common = require('../common.js');
+const bench = common.createBenchmark(main, {
+ n: [1e5]
+});
+
+function main({ n }) {
+ bench.start();
+ for (let i = 0; i < n; i++) {
+ process.resourceUsage();
+ }
+ bench.end(n);
+}