Skip to content

Commit a47116e

Browse files
committed
fix allocator bench
1 parent f6e5d41 commit a47116e

2 files changed

Lines changed: 18 additions & 9 deletions

File tree

.github/scripts/allocator_bench_unix.sh

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@
55
#
66
# Inputs (env):
77
# ALLOCATOR system | auto | jemalloc | jemalloc_override |
8-
# mimalloc_v2 | mimalloc_v2_no_thp | mimalloc_v3 |
9-
# mimalloc_v3_no_thp | mimalloc_v3_override
8+
# mimalloc_v2 | mimalloc_v3 | mimalloc_v3_override,
9+
# optionally with a "_dup" suffix, which builds the same
10+
# binary under a second job so the report can show the
11+
# between-job noise for that allocator. The suffix is
12+
# recorded but never reaches the feature list.
1013
# TOKIO_MULTI_THREAD true | false
11-
# WORKLOADS space-separated subset of "check scrape"
14+
# WORKLOADS space-separated subset of "check scrape tls"
1215
# ALLOC_ENVS ';'-separated run-time tuning variants, each
1316
# "name:VAR=VAL[ VAR=VAL...]" or just "default"
1417
# PLATFORM_LABEL matrix label, recorded verbatim
@@ -36,12 +39,15 @@ features=""
3639
no_default="--no-default-features"
3740
# A "_dup" cell builds the identical binary under a second job so the report can
3841
# show the between-job noise for that allocator rather than assume it. Only the
39-
# recorded label differs, so the suffix comes off before feature selection.
40-
case "${ALLOCATOR%_dup}" in
42+
# recorded label carries the suffix; strip it once, here, and use the stripped
43+
# name for every feature decision below. Stripping it in the `case` subject
44+
# alone is not enough - the default branch has to use it too.
45+
allocator_features="${ALLOCATOR%_dup}"
46+
case "$allocator_features" in
4147
system) ;;
4248
auto) no_default="" ;;
4349
mimalloc_v3_override) features="mimalloc_v3,mimalloc_override" ;;
44-
*) features="$ALLOCATOR" ;;
50+
*) features="$allocator_features" ;;
4551
esac
4652
if [ "$TOKIO_MULTI_THREAD" = "true" ]; then
4753
features="${features:+$features,}tokio-multi-thread"

.github/scripts/allocator_bench_windows.ps1

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,15 @@ $mt = if ($env:TOKIO_MULTI_THREAD -eq 'true') { 'true' } else { 'false' }
3232
$features = @()
3333
$noDefault = @('--no-default-features')
3434
# See allocator_bench_unix.sh: a "_dup" cell is the same binary under a second
35-
# job, used to measure between-job noise, so the suffix comes off here.
36-
switch ($allocator -replace '_dup$', '') {
35+
# job, used to measure between-job noise. Strip the suffix once into its own
36+
# variable - stripping it in the switch subject alone leaves the default branch
37+
# adding the unstripped name as a feature.
38+
$allocatorFeatures = $allocator -replace '_dup$', ''
39+
switch ($allocatorFeatures) {
3740
'system' { }
3841
'auto' { $noDefault = @() }
3942
'mimalloc_v3_override' { $features += 'mimalloc_v3'; $features += 'mimalloc_override' }
40-
default { $features += $allocator }
43+
default { $features += $allocatorFeatures }
4144
}
4245
if ($mt -eq 'true') { $features += 'tokio-multi-thread' }
4346

0 commit comments

Comments
 (0)