summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/v8/serialize.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/benchmark/v8/serialize.js b/benchmark/v8/serialize.js
new file mode 100644
index 0000000000..331c576a1b
--- /dev/null
+++ b/benchmark/v8/serialize.js
@@ -0,0 +1,17 @@
+'use strict';
+
+const common = require('../common.js');
+const v8 = require('v8');
+
+const bench = common.createBenchmark(main, {
+ len: [256, 1024 * 16, 1024 * 512],
+ n: [1e6]
+});
+
+function main({ n, len }) {
+ const typedArray = new BigUint64Array(len);
+ bench.start();
+ for (let i = 0; i < n; i++)
+ v8.serialize({ a: 1, b: typedArray });
+ bench.end(n);
+}