Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 07b7db2

Browse filesBrowse files
danbevcodebytere
authored andcommitted
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: #24033 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 4d1a803 commit 07b7db2
Copy full SHA for 07b7db2

File tree

Expand file treeCollapse file tree

4 files changed

+10
-8
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

4 files changed

+10
-8
lines changed
Open diff view settings
Collapse file

‎Makefile‎

Copy file name to clipboardExpand all lines: Makefile
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ test-valgrind: all
308308
test-check-deopts: all
309309
$(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) --check-deopts parallel sequential
310310

311-
benchmark/napi/function_call/build/Release/binding.node: \
311+
benchmark/napi/function_call/build/$(BUILDTYPE)/binding.node: \
312312
benchmark/napi/function_call/napi_binding.c \
313313
benchmark/napi/function_call/binding.cc \
314314
benchmark/napi/function_call/binding.gyp | all
@@ -317,7 +317,7 @@ benchmark/napi/function_call/build/Release/binding.node: \
317317
--directory="$(shell pwd)/benchmark/napi/function_call" \
318318
--nodedir="$(shell pwd)"
319319

320-
benchmark/napi/function_args/build/Release/binding.node: \
320+
benchmark/napi/function_args/build/$(BUILDTYPE)/binding.node: \
321321
benchmark/napi/function_args/napi_binding.c \
322322
benchmark/napi/function_args/binding.cc \
323323
benchmark/napi/function_args/binding.gyp | all
@@ -1046,8 +1046,8 @@ bench: bench-addons-build
10461046

10471047
# Build required addons for benchmark before running it.
10481048
.PHONY: bench-addons-build
1049-
bench-addons-build: benchmark/napi/function_call/build/Release/binding.node \
1050-
benchmark/napi/function_args/build/Release/binding.node
1049+
bench-addons-build: benchmark/napi/function_call/build/$(BUILDTYPE)/binding.node \
1050+
benchmark/napi/function_args/build/$(BUILDTYPE)/binding.node
10511051

10521052
.PHONY: bench-addons-clean
10531053
bench-addons-clean:
Collapse file

‎benchmark/common.js‎

Copy file name to clipboardExpand all lines: benchmark/common.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
const child_process = require('child_process');
44
const http_benchmarkers = require('./_http-benchmarkers.js');
55

6+
exports.buildType = process.features.debug ? 'Debug' : 'Release';
7+
68
exports.createBenchmark = function(fn, configs, options) {
79
return new Benchmark(fn, configs, options);
810
};
Collapse file

‎benchmark/napi/function_args/index.js‎

Copy file name to clipboardExpand all lines: benchmark/napi/function_args/index.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ let v8;
1010
let napi;
1111

1212
try {
13-
v8 = require('./build/Release/binding');
13+
v8 = require(`./build/${common.buildType}/binding`);
1414
} catch {
1515
console.error(`${__filename}: V8 Binding failed to load`);
1616
process.exit(0);
1717
}
1818

1919
try {
20-
napi = require('./build/Release/napi_binding');
20+
napi = require(`./build/${common.buildType}/napi_binding`);
2121
} catch {
2222
console.error(`${__filename}: NAPI-Binding failed to load`);
2323
process.exit(0);
Collapse file

‎benchmark/napi/function_call/index.js‎

Copy file name to clipboardExpand all lines: benchmark/napi/function_call/index.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const common = require('../../common.js');
1212
// abort quietly.
1313

1414
try {
15-
var binding = require('./build/Release/binding');
15+
var binding = require(`./build/${common.buildType}/binding`);
1616
} catch {
1717
console.error('misc/function_call.js Binding failed to load');
1818
process.exit(0);
@@ -21,7 +21,7 @@ const cxx = binding.hello;
2121

2222
let napi_binding;
2323
try {
24-
napi_binding = require('./build/Release/napi_binding');
24+
napi_binding = require(`./build/${common.buildType}/napi_binding`);
2525
} catch {
2626
console.error('misc/function_call/index.js NAPI-Binding failed to load');
2727
process.exit(0);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.