summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2023-06-15 17:20:43 +0200
committerMichał Górny <mgorny@gentoo.org>2023-06-18 16:57:44 +0200
commit59dbfb80f748a0fc5741a8f3028f7552af28eecf (patch)
treead2d9f79716f56f00a08c8e596403077b7056165 /eclass/tests
parenteclass/tests: Add a minimal benchmark for cargo.eclass (diff)
downloadgentoo-59dbfb80f748a0fc5741a8f3028f7552af28eecf.tar.gz
gentoo-59dbfb80f748a0fc5741a8f3028f7552af28eecf.tar.bz2
gentoo-59dbfb80f748a0fc5741a8f3028f7552af28eecf.zip
cargo.eclass: Add variable alternative to $(cargo_crate_uris)
Add a helper function that sets ${CARGO_CRATE_URIS} variable to make it possible to set SRC_URI without subshells. This gives a slight speedup (~20%): ``` real 300 it/s user 324 it/s ``` Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass/tests')
-rwxr-xr-xeclass/tests/cargo-bench.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/eclass/tests/cargo-bench.sh b/eclass/tests/cargo-bench.sh
index cdc5e4431c14..11b740f8dfcd 100755
--- a/eclass/tests/cargo-bench.sh
+++ b/eclass/tests/cargo-bench.sh
@@ -12,8 +12,9 @@ RUNS=3
doit() {
for (( i = 0; i < ITERATIONS; i++ )); do
+ _cargo_set_crate_uris "${CRATES}"
SRC_URI="
- $(cargo_crate_uris)
+ ${CARGO_CRATE_URIS}
"
done
}
@@ -102,6 +103,7 @@ CRATES="
"
inherit cargo
+
timeit
texit