Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed Feb 5, 2025
1 parent 668f64c commit 13a82ca
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 31 deletions.
27 changes: 5 additions & 22 deletions .github/workflows/reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -471,12 +471,11 @@ jobs:
contents: write

steps:
- uses: actions/checkout@v4

- name: Download initial compilation report
uses: actions/download-artifact@v4
with:
name: in_progress_compilation_report
path: ./reports

- name: Download matrix compilation reports
uses: actions/download-artifact@v4
Expand All @@ -486,9 +485,7 @@ jobs:

- name: Merge compilation reports using jq
run: |
mv ./.github/scripts/merge-bench-reports.sh merge-bench-reports.sh
./merge-bench-reports.sh compilation_report
jq ".compilation_reports | map({name: .artifact_name, value: (.time[:-1] | tonumber), unit: \"s\"}) " ./compilation_report.json > time_bench.json
jq --slurp '.' ./reports/*.json > time_bench.json
- name: Store benchmark result
continue-on-error: true
Expand Down Expand Up @@ -520,8 +517,6 @@ jobs:
contents: write

steps:
- uses: actions/checkout@v4

- name: Download initial memory report
uses: actions/download-artifact@v4
with:
Expand All @@ -535,9 +530,7 @@ jobs:

- name: Merge memory reports using jq
run: |
mv ./.github/scripts/merge-bench-reports.sh merge-bench-reports.sh
./merge-bench-reports.sh memory_report
jq ".memory_reports | map({name: .artifact_name, value: (.peak_memory | tonumber), unit: \"MB\"}) " ./memory_report.json > memory_bench.json
jq --slurp '.' ./reports/*.json > memory_bench.json
- name: Store benchmark result
continue-on-error: true
Expand Down Expand Up @@ -569,8 +562,6 @@ jobs:
contents: write

steps:
- uses: actions/checkout@v4

- name: Download initial memory report
uses: actions/download-artifact@v4
with:
Expand All @@ -584,11 +575,7 @@ jobs:

- name: Merge memory reports using jq
run: |
mv ./.github/scripts/merge-bench-reports.sh merge-bench-reports.sh
./merge-bench-reports.sh memory_report
# Rename the memory report as to not clash with the compilation memory report file name
cp memory_report.json execution_memory_report.json
jq ".memory_reports | map({name: .artifact_name, value: (.peak_memory | tonumber), unit: \"MB\"}) " ./execution_memory_report.json > memory_bench.json
jq --slurp '.' ./reports/*.json > memory_bench.json
- name: Store benchmark result
continue-on-error: true
Expand Down Expand Up @@ -621,8 +608,6 @@ jobs:
contents: write

steps:
- uses: actions/checkout@v4

- name: Download initial execution report
uses: actions/download-artifact@v4
with:
Expand All @@ -636,9 +621,7 @@ jobs:

- name: Merge execution reports using jq
run: |
mv ./.github/scripts/merge-bench-reports.sh merge-bench-reports.sh
./merge-bench-reports.sh execution_report
jq ".execution_reports | map({name: .artifact_name, value: (.time[:-1] | tonumber), unit: \"s\"}) " ./execution_report.json > time_bench.json
jq --slurp '.' ./reports/*.json > time_bench.json
- name: Store benchmark result
continue-on-error: true
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-js-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ jobs:
- name: Merge test reports using jq
run: |
jq --slurp '.' ./reports/*.json > test_bench.json
- name: Store benchmark result
continue-on-error: true
uses: benchmark-action/github-action-benchmark@4de1bed97a47495fc4c5404952da0499e31f5c29
Expand Down
6 changes: 3 additions & 3 deletions test_programs/compilation_report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ base_path="$current_dir/execution_success"
# Tests to be profiled for compilation report
tests_to_profile=("sha256_regression" "regression_4709" "ram_blowup_regression" "global_var_regression_entry_points")

echo "{\"compilation_reports\": [ " > $current_dir/compilation_report.json
echo "[ " > $current_dir/compilation_report.json

# If there is an argument that means we want to generate a report for only the current directory
if [ "$1" == "1" ]; then
Expand Down Expand Up @@ -62,7 +62,7 @@ for dir in ${tests_to_profile[@]}; do
printf "%.3f\n", 0
}' <<<"${TIMES[@]}")

jq -rc "{artifact_name: \"$PACKAGE_NAME\", time: \""$AVG_TIME"s\"}" --null-input >> $current_dir/compilation_report.json
jq -rc "{name: \"$PACKAGE_NAME\", value: tonumber(\""$AVG_TIME"\"), unit: \"s\"}" --null-input >> $current_dir/compilation_report.json

if (($ITER != $NUM_ARTIFACTS)); then
echo "," >> $current_dir/compilation_report.json
Expand All @@ -73,4 +73,4 @@ for dir in ${tests_to_profile[@]}; do
ITER=$(( $ITER + 1 ))
done

echo "]}" >> $current_dir/compilation_report.json
echo "]" >> $current_dir/compilation_report.json
6 changes: 3 additions & 3 deletions test_programs/execution_report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ base_path="$current_dir/execution_success"
# Tests to be profiled for execution report
tests_to_profile=("sha256_regression" "regression_4709" "ram_blowup_regression" "global_var_regression_entry_points")

echo "{\"execution_reports\": [ " > $current_dir/execution_report.json
echo "{[" > $current_dir/execution_report.json

# If there is an argument that means we want to generate a report for only the current directory
if [ "$1" == "1" ]; then
Expand Down Expand Up @@ -70,7 +70,7 @@ for dir in ${tests_to_profile[@]}; do
printf "%.3f\n", 0
}' <<<"${TIMES[@]}")

jq -rc "{artifact_name: \"$PACKAGE_NAME\", time: \""$AVG_TIME"s\"}" --null-input >> $current_dir/execution_report.json
jq -rc "{name: \"$PACKAGE_NAME\", value: tonumber(\""$AVG_TIME"\"), unit: \"s\"}" --null-input >> $current_dir/execution_report.json

if (($ITER != $NUM_ARTIFACTS)); then
echo "," >> $current_dir/execution_report.json
Expand All @@ -81,4 +81,4 @@ for dir in ${tests_to_profile[@]}; do
ITER=$(( $ITER + 1 ))
done

echo "]}" >> $current_dir/execution_report.json
echo "]" >> $current_dir/execution_report.json
7 changes: 4 additions & 3 deletions test_programs/memory_report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fi
FIRST="1"

FLAGS=${FLAGS:- ""}
echo "{\"memory_reports\": [ " > memory_report.json
echo "[" > memory_report.json

for test_name in ${tests_to_profile[@]}; do
cd $base_path/$test_name
Expand Down Expand Up @@ -57,8 +57,9 @@ for test_name in ${tests_to_profile[@]}; do
peak=${consumption:30:len}
rm $current_dir/$test_name"_heap_analysis.txt"
peak_memory=$($PARSE_MEMORY $peak)
echo -e " {\n \"artifact_name\":\"$test_name\",\n \"peak_memory\":\"$peak_memory\"\n }" >> $current_dir"/memory_report.json"
jq -rc "{name: \"$PACKAGE_NAME\", value: tonumber(\"$peak_memory\"), unit: \"MB\"}" --null-input >> $current_dir/memory_report.json

done

echo "]}" >> $current_dir"/memory_report.json"
echo "]" >> $current_dir"/memory_report.json"

0 comments on commit 13a82ca

Please sign in to comment.