Skip to content

Commit 14fcd5d

Browse files
authored
Merge pull request #15965 from ethereum/repeats_for_external_benchmarks
Adds repeats to external benchmarks
2 parents 6326b86 + 77878e5 commit 14fcd5d

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Diff for: test/benchmarks/external.sh

+10-5
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ source "${repo_root}/scripts/common.sh"
4242
# shellcheck source=scripts/common_cmdline.sh
4343
source "${repo_root}/scripts/common_cmdline.sh"
4444

45-
(( $# <= 1 )) || fail "Too many arguments. Usage: external.sh [<solc-path>]"
45+
(( $# <= 2 )) || fail "Too many arguments. Usage: external.sh [<solc-path>] [<num-repeats>]"
4646

4747
solc="${1:-${SOLIDITY_BUILD_DIR}/solc/solc}"
48+
num_repeats="${2:-1}"
4849
command_available "$solc" --version
4950
command_available "$(type -P time)" --version
5051

@@ -65,10 +66,10 @@ function benchmark_project {
6566
> /dev/null \
6667
2> "../stderr-${project}-${pipeline}.log" || true
6768

68-
printf '| %-21s | %8s | %6d s | %9d MiB | %9d |\n' \
69+
printf '| %-21s | %8s | %6.2f s | %9d MiB | %9d |\n' \
6970
"$project" \
7071
"$pipeline" \
71-
"$(jq '(.user + .sys) | round' "$time_file")" \
72+
"$(jq '(.user + .sys) * 100 | round / 100' "$time_file")" \
7273
"$(jq '.mem / 1024 | round' "$time_file")" \
7374
"$(jq '.exit' "$time_file")"
7475
cd ..
@@ -96,8 +97,12 @@ echo "| File | Pipeline | Time | Memory (peak) | Exit code
9697
echo "|-----------------------|----------|---------:|--------------:|----------:|"
9798

9899
for project in "${benchmarks[@]}"; do
99-
benchmark_project legacy "$project"
100-
benchmark_project ir "$project"
100+
for ((i=0; i<num_repeats; i++)); do
101+
benchmark_project legacy "$project"
102+
done
103+
for ((i=0; i<num_repeats; i++)); do
104+
benchmark_project ir "$project"
105+
done
101106
done
102107

103108
for project in "${benchmarks[@]}"; do

0 commit comments

Comments
 (0)