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
Use cargo-binstall to fast install critcmp for benchmark-compare #3637
Use cargo-binstall to fast install critcmp for benchmark-compare #3637
Conversation
PR Check ResultsEcosystem✅ ecosystem check detected no changes. BenchmarkLinux
Windows
|
@@ -26,7 +26,7 @@ jobs: | |||
- name: "PR - Install Rust toolchain" | |||
run: rustup show | |||
|
|||
- uses: Swatinem/rust-cache@v1 | |||
- uses: Swatinem/rust-cache@v2 |
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.
whoops, thx
.github/workflows/benchmark.yaml
Outdated
- name: "Install Rust toolchain" | ||
run: rustup show | ||
|
||
- uses: Swatinem/rust-cache@v2 |
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.
I considered adding rust-cache to the critcmp step but decided against it because GitHub limits the cache per repository to 10GB. That means GitHub starts evicting cached artifacts once we exceed the 10GB limit. You can see all our cache artifacts here.
Now, the reason I excluded critcmp
was to avoid adding yet another cache (where each cache is around 600MB) that results in the eviction of other cached artifacts (e.g., for the clippy process) because I thought having warm caches for clippy is more important than for the benchmark results.
I don't know if that's the right call, nor have I verified my assumption that caching the critcmp
build causes any build time regression for other jobs. So happy to give it a try. But do we need to built critcmp
in the first place...
I researched more to find ways to avoid building critcmp
altogether. I was excited when I read that criterion 0.4 has built-in tabulating. No need to use critcmp
, we can generate the comparison directly in the benchmark step. Unfortunately, they removed tabulating before the release in favor of adding it to cargo-criterion
. I tried cargo criterion
locally, but the feature doesn't seem to exist, and even if it does, we would only be switching one dependency for another.
So what if we could avoid running cargo install
altogether? Can we download the critcmp
binary or cache it somehow? That's when I discovered cargo-binstall
. It installs binaries rather than building the crates from source... yay! Uhm, okay, but how do we install cargo-binstall
?
cargo-binstall
recommends using install-development-tools: uses: taiki-e/install-action@cargo-binstall
. All that's left to do is to run cargo binstall critcmp
(maybe figure out the right options)
Luckily cargo-binstall
publishes prebuilt binaries on GitHub and there are even a github actions to download binaries from the release page (release-downloader or dtonlay/install
). Alternatively, we could just use curl
or wget
to get the binary. Do you want to give this at try?
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.
Yes!
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.
Currently, critcmp
does not seem to have prebuilt binaries on GitHub.
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.
This shouldn't be necessary as far as I understand. You can use cargo binstall
to install critcmp
. It uses the quickinstall
registry under the hood that provides pre-built binaries (at least it works on my linux machine)
❯ cargo binstall critcmp -y
INFO resolve: Resolving package: 'critcmp'
WARN The package critcmp v0.1.7 will be downloaded from third-party source QuickInstall
INFO This will install the following binaries:
INFO - critcmp (critcmp -> /home/micha/.cargo/bin/critcmp-v0.1.7)
INFO And create (or update) the following symlinks:
INFO - critcmp (/home/micha/.cargo/bin/critcmp -> critcmp-v0.1.7)
INFO Installing binaries...
INFO Done in 2.070975169s
3s instead of 2m3s to install |
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.
3s instead of 2m3s to install
critcmp
!
Whooohoo nice 🥳 ! Thanks for working on this.
@Boshen some more benchmark CI performance improvements ;)
Whoops, I should have changed the title before merging... Too late 🙅 |
Should it be revert and merge again with the good title? |
I think we're good. There are more fun things to do, and it isn't that bad in my view. The title may be misleading because the implementation is different but it correctly points out which part of the system was changed, and the PR contains all details. |
No description provided.