-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new(ci,benchmarks): added more benchmarks and make use of them in perf CI #2023
Changes from all commits
696c09c
b8ded59
9ee37cf
378dfec
c78d9a6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,13 @@ jobs: | |
- name: Checkout Libs ⤵️ | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- name: Checkout Google benchmark ⤵️ | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
repository: 'google/benchmark' | ||
ref: 'v1.9.0' | ||
path: google-benchmark/ | ||
|
||
- name: Run perf | ||
id: perf | ||
uses: ./.github/actions/composite-perf | ||
|
@@ -43,6 +50,11 @@ jobs: | |
run: | | ||
sudo heaptrack_print heaptrack_scap.data.zst -d ${{ steps.perf.outputs.heaptrack_scap }} &> heaptrack_scap_diff.txt | ||
|
||
- name: Diff from master - gbench | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The algorithm is as follows:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have you ever considered to use the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Neat! I'll give it a look and eventually implement it! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Implemented, thanks! |
||
run: | | ||
pip3 install -r google-benchmark/tools/requirements.txt | ||
python3 google-benchmark/tools/compare.py --no-color benchmarks gbench_data.json ${{ steps.perf.outputs.gbench_json }} &> gbench_diff.txt | ||
|
||
- name: Archive perf diff | ||
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 | ||
with: | ||
|
@@ -75,6 +87,10 @@ jobs: | |
echo "\`\`\`" >> ./pr/COMMENT | ||
tail -n3 "heaptrack_scap_diff.txt" >> ./pr/COMMENT | ||
echo "\`\`\`" >> ./pr/COMMENT | ||
echo "# Benchmarks diff from master" >> ./pr/COMMENT | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the PERF comment, echo the full benchmark diffs. |
||
echo "\`\`\`" >> ./pr/COMMENT | ||
cat "gbench_diff.txt" >> ./pr/COMMENT | ||
echo "\`\`\`" >> ./pr/COMMENT | ||
echo Uploading PR info... | ||
cat ./pr/COMMENT | ||
echo "" | ||
|
@@ -135,3 +151,15 @@ jobs: | |
if [ -s heaptrack_scap_diff_above_thresh.txt ]; then | ||
exit 2 | ||
fi | ||
|
||
# Check will fail if there any google benchmark is slowed more than 5% | ||
- name: Check >= 5% slowdown on google benchmarks | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For every benchmark in our diff, check if diff in percentage is above 5% and eventually trigger a failure. |
||
if: always() # Even if other threshold checks failed | ||
run: | | ||
# Remove first 3 lines and last line that are no tests results | ||
tail -n+4 gbench_diff.txt | head -n -1 | while read p; do | ||
diff_pct=$(echo "$p" | awk '{print $3}' | tr -d '+') | ||
if (( $(echo "$diff_pct >= 5.0" | bc -l) )); then | ||
exit 1 | ||
fi | ||
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pages CI will now upload also master gbench json too.