mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
d64835f97e
Add a micro benchmark for external buffer creation. PR-URL: https://github.com/nodejs/node/pull/54877 Refs: https://github.com/nodejs/node/issues/53804 Refs: https://github.com/nodejs/node/issues/44111 Reviewed-By: Gabriel Schulhof <gabrielschulhof@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
15 lines
338 B
JavaScript
15 lines
338 B
JavaScript
'use strict';
|
|
|
|
const common = require('../../common.js');
|
|
|
|
const bench = common.createBenchmark(main, {
|
|
n: [5e6],
|
|
addon: ['binding', 'binding_node_api_v8'],
|
|
implem: ['createExternalBuffer'],
|
|
});
|
|
|
|
function main({ n, implem, addon }) {
|
|
const binding = require(`./build/${common.buildType}/${addon}`);
|
|
binding[implem](bench, n);
|
|
}
|