mirror of
https://github.com/nodejs/node.git
synced 2026-10-28 10:15:07 +08:00
benchmark: remove duplicate ffi add-64 benchmark
add-64.js measured the same add_f64 symbol with the same signature as add-f64.js and differed only in its argument constants. Signed-off-by: Soul Lee <alus20x@gmail.com> PR-URL: https://github.com/nodejs/node/pull/66121 Refs: https://github.com/nodejs/node/pull/63068 Refs: https://github.com/nodejs/node/pull/62918 Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
3ad6dd49d9
commit
b3fc35134e
1 file changed
-26
@@ -1,26 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const common = require('../common.js');
|
||||
const ffi = require('node:ffi');
|
||||
const { libraryPath, ensureFixtureLibrary } = require('./common.js');
|
||||
|
||||
const bench = common.createBenchmark(main, {
|
||||
n: [1e7],
|
||||
});
|
||||
|
||||
ensureFixtureLibrary();
|
||||
|
||||
const { lib, functions } = ffi.dlopen(libraryPath, {
|
||||
add_f64: { return: 'f64', arguments: ['f64', 'f64'] },
|
||||
});
|
||||
|
||||
const add = functions.add_f64;
|
||||
|
||||
function main({ n }) {
|
||||
bench.start();
|
||||
for (let i = 0; i < n; ++i)
|
||||
add(20.5, 21.5);
|
||||
bench.end(n);
|
||||
|
||||
lib.close();
|
||||
}
|
||||
Reference in new issue
Block a user