-
Notifications
You must be signed in to change notification settings - Fork 112
ci(circleci): add benchmark comparisons #147
Conversation
4d3ce76
to
6dca0e9
Compare
2a6239e
to
c0f6e39
Compare
Run benchmarks before and after, compare results
b8cf00b
to
4238f53
Compare
4238f53
to
31553b7
Compare
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.
The benchmarks look good but I'd like to avoid duplicating the CI scripts. And yeah, 25% sucks but it's CI.
Thanks for putting this together!
bin/build.sh
Outdated
done | ||
} | ||
|
||
build_all |
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.
We don't need this file.
bin/run-benchmarks.sh
Outdated
fi | ||
( cd "$dir"; go build -buildmode=$buildmode -o /dev/null "$pkg") | ||
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.
We can probably skip all of this logic and just rely on the standard test scripts.
bin/run-benchmarks.sh
Outdated
display_and_run BENCHMARK_SEED="$$" ./bin/benchmark-to-file.sh benchmark-after.txt after | ||
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then | ||
display_and_run ./bin/diff-benchmarks.sh benchmark-before.txt benchmark-after.txt | ||
fi |
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.
Let's have \n
at the ends of scripts. This is standard on unix systems.
shellcheck pointed these out:
|
Remove unused code, follow conventions
@Stebalien + @Kubuxu incorporated suggestions though I wasn't sure what to do with "The benchmarks look good but I'd like to avoid duplicating the CI scripts." Anyway let me know if I can merge. |
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.
LGTM! ❤️
The "duplicate code" comment was referring to the code duplicated from https://raw.githubusercontent.com/ipfs/ci-helpers/master/travis-ci/run-standard-tests.sh
Goals
Add Benchmarking to CI in Bitswap!
Implementation
This adds a new job to Bitswap's Travis Config that runs benchmarks across both master and the current branch based on ipfs/kubo#6446 but adopted for Travis instead of CircleCI (various script config changes, etc)
Also, required making a few patches to benchmarks so they aren't failing and also seeded on a similar random seed. These were merged in master so this PR could complete CI w/o failing. (#dontHateMe)
For Discussion
I can't get these to predictably and reliably pass without setting the threshold lower than <5% --- I've got it currently set at <25%, which is a bummer in that it's imprecise but still protects against order of magnitude regressions ala what happened with 0.4.21.
Also, this does mean CI takes somewhat longer, about 6 minutes.