-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: Enable
concurrent
in codspeed bench (#9862)
**Description:** This PR enables cargo feature `concurrent` for codspeed benchmark done by CI machine for crates that have a such feature.
- Loading branch information
Showing
3 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eu | ||
|
||
echo "Building all crates for codspeed" | ||
|
||
WS_CRATES=$(./scripts/cargo/list-crates.sh) | ||
|
||
# Get crate names | ||
CRATE_NAMES=$(echo "$WS_CRATES" | jq -r '.name') | ||
|
||
for crate in $CRATE_NAMES; do | ||
# If crate is swc_plugin_runner, skip it | ||
if [[ $crate == "swc_plugin_runner" ]]; then | ||
continue | ||
fi | ||
|
||
crate_info=$(echo "$WS_CRATES" | jq -r 'select(.name == "'$crate'")') | ||
bench_targets=$(echo $crate_info | jq -r '.targets[] | select(.kind | contains(["bench"]))') | ||
|
||
|
||
# If crate has no benchmark target, skip it | ||
if [[ -z $bench_targets ]]; then | ||
echo "Skipping $crate because it has no benchmark target" | ||
continue | ||
fi | ||
|
||
# If crate has feature 'concurrent', build it with feature | ||
if [[ $(./scripts/cargo/list-features.sh $crate) == *"concurrent"* ]]; then | ||
echo "Building $crate with feature 'concurrent'" | ||
cargo codspeed build -p $crate --features concurrent | ||
else | ||
echo "Building $crate" | ||
cargo codspeed build -p $crate | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eu | ||
|
||
|
||
|
||
# Prints json for workspace crates | ||
|
||
cargo metadata --format-version 1 | jq -r '.packages[] | select(.source == null and .name == "'$1'") | .features' |