summaryrefslogtreecommitdiff
path: root/benchmark/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark/crypto')
-rw-r--r--benchmark/crypto/get-ciphers.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/benchmark/crypto/get-ciphers.js b/benchmark/crypto/get-ciphers.js
new file mode 100644
index 0000000000..257c9af2fd
--- /dev/null
+++ b/benchmark/crypto/get-ciphers.js
@@ -0,0 +1,20 @@
+'use strict';
+
+const common = require('../common.js');
+
+const bench = common.createBenchmark(main, {
+ n: [1, 5000],
+ v: ['crypto', 'tls']
+});
+
+function main(conf) {
+ const n = +conf.n;
+ const v = conf.v;
+ const method = require(v).getCiphers;
+ var i = 0;
+
+ common.v8ForceOptimization(method);
+ bench.start();
+ for (; i < n; i++) method();
+ bench.end(n);
+}