Skip to content

Commit

Permalink
benchmark: add v8 serialize benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig committed Nov 15, 2022
1 parent 0d8a782 commit 9243af9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions benchmark/v8/serialize.js
@@ -0,0 +1,16 @@
'use strict';

const common = require('../common.js');
const v8 = require('v8');

const bench = common.createBenchmark(main, {
n: [1e6]
});

function main({ n }) {
const typedArray = new BigUint64Array();
bench.start();
for (let i = 0; i < n; i++)
v8.serialize({ a: 1, b: typedArray });
bench.end(n);
}

0 comments on commit 9243af9

Please sign in to comment.