mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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);
|
||
|
|
}
|