summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
authorDaniel Bevenius <daniel.bevenius@gmail.com>2018-11-02 07:53:57 +0100
committerRefael Ackermann <refack@gmail.com>2018-11-11 12:09:25 -0500
commitce6ec368a6ca1731323de074e0dbafaad2426e2b (patch)
treefe2a97e78c68b5f9e96c32d481632649da380dc6 /benchmark
parent288076d4a50df88c600ca6ac006b0e8fb0826780 (diff)
downloadandroid-node-v8-ce6ec368a6ca1731323de074e0dbafaad2426e2b.tar.gz
android-node-v8-ce6ec368a6ca1731323de074e0dbafaad2426e2b.tar.bz2
android-node-v8-ce6ec368a6ca1731323de074e0dbafaad2426e2b.zip
build: use BUILDTYPE in bench-addons-build targets
This commit uses the BUILDTYPE for the benchmark targets that currently explicitly use Release as the build type. The motivation for this change is allows switching between debug builds and release builds using the bench-addons-clean/bench-addons-build targets. PR-URL: https://github.com/nodejs/node/pull/24033 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/common.js2
-rw-r--r--benchmark/napi/function_args/index.js4
-rw-r--r--benchmark/napi/function_call/index.js4
3 files changed, 6 insertions, 4 deletions
diff --git a/benchmark/common.js b/benchmark/common.js
index 79aef5a55f..c76831b573 100644
--- a/benchmark/common.js
+++ b/benchmark/common.js
@@ -3,6 +3,8 @@
const child_process = require('child_process');
const http_benchmarkers = require('./_http-benchmarkers.js');
+exports.buildType = process.features.debug ? 'Debug' : 'Release';
+
exports.createBenchmark = function(fn, configs, options) {
return new Benchmark(fn, configs, options);
};
diff --git a/benchmark/napi/function_args/index.js b/benchmark/napi/function_args/index.js
index c41b5d78ab..df567dcfcc 100644
--- a/benchmark/napi/function_args/index.js
+++ b/benchmark/napi/function_args/index.js
@@ -10,14 +10,14 @@ let v8;
let napi;
try {
- v8 = require('./build/Release/binding');
+ v8 = require(`./build/${common.buildType}/binding`);
} catch {
console.error(`${__filename}: V8 Binding failed to load`);
process.exit(0);
}
try {
- napi = require('./build/Release/napi_binding');
+ napi = require(`./build/${common.buildType}/napi_binding`);
} catch {
console.error(`${__filename}: NAPI-Binding failed to load`);
process.exit(0);
diff --git a/benchmark/napi/function_call/index.js b/benchmark/napi/function_call/index.js
index 272c41662d..59063e500f 100644
--- a/benchmark/napi/function_call/index.js
+++ b/benchmark/napi/function_call/index.js
@@ -12,7 +12,7 @@ const common = require('../../common.js');
// abort quietly.
try {
- var binding = require('./build/Release/binding');
+ var binding = require(`./build/${common.buildType}/binding`);
} catch {
console.error('misc/function_call.js Binding failed to load');
process.exit(0);
@@ -21,7 +21,7 @@ const cxx = binding.hello;
let napi_binding;
try {
- napi_binding = require('./build/Release/napi_binding');
+ napi_binding = require(`./build/${common.buildType}/napi_binding`);
} catch {
console.error('misc/function_call/index.js NAPI-Binding failed to load');
process.exit(0);