Skip to content

Commit d1e747a

Browse files
committed
benchmark,tools: fix napi benchmarks on GHA
The GHA benchmark never built the addons of benchmark/napi, and its --debug-node build made benchmark/common.js look for them in build/Debug. Build them when the napi category runs, and pick the build type as test/common does. Refs: #66395 Signed-off-by: Nigro Simone <nigro.simone@gmail.com>
1 parent a3219b6 commit d1e747a

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

‎.github/workflows/benchmark.yml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,18 +140,22 @@ jobs:
140140
run: |
141141
nix-shell \
142142
-I nixpkgs=./tools/nix/pkgs.nix \
143-
--pure --keep SCCACHE_LOCAL_RW_MODE \
143+
--pure --keep SCCACHE_LOCAL_RW_MODE --keep CATEGORIES \
144144
--arg useSeparateDerivationForV8 true \
145145
--arg withPerfetto ${{ matrix.perfetto || false }} \
146146
--arg loadJSBuiltinsDynamically false \
147147
--arg ccache '(import <nixpkgs> {}).sccache' \
148148
--arg devTools '[]' \
149149
--arg benchmarkTools '[]' \
150150
--run '
151+
set -e
151152
make build-ci -j4 V=1
153+
# The napi benchmarks load addons of their own, both binaries use these.
154+
if [[ " $CATEGORIES " == *" napi "* ]]; then make bench-addons-build; fi
152155
'
153156
env:
154157
SCCACHE_LOCAL_RW_MODE: READ_ONLY
158+
CATEGORIES: ${{ inputs.category }}
155159

156160
- name: Run benchmark
157161
run: |

‎benchmark/common.js‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,11 @@ module.exports = {
470470
return process.binding(bindingName);
471471
}
472472
},
473-
buildType: process.features.debug ? 'Debug' : 'Release',
473+
// As in test/common: a --debug-node build is still a Release build, and its
474+
// addons are in build/Release.
475+
buildType: process.config.target_defaults ?
476+
process.config.target_defaults.default_configuration :
477+
'Release',
474478
createBenchmark(fn, configs, options) {
475479
return new Benchmark(fn, configs, options);
476480
},

0 commit comments

Comments
 (0)