CodSpeedHQ / codspeed-rust

Rust crates to create CodSpeed benchmarks
https://codspeed.io
Apache License 2.0
24 stars 9 forks source link

Explore ways to speed up compilation #16

Closed Boshen closed 1 year ago

Boshen commented 1 year ago

For my project, https://github.com/web-infra-dev/oxc/actions/runs/6095539763/job/16539311128, it is currently taking 4 minutes to compile 5 benchmarks. I'd like to explore ways to speed things up a little bit because I am planning to add more benchmarks.

You can give me things to try or tell me the things you have tried so I don't waste too much time on this.

MichaReiser commented 1 year ago

How does the compile time compare to compiling without codspeed (using "plain" criterion)?

art049 commented 1 year ago

Have you tried caching release artifacts? We're doing it for the self-benchmarks of this repository, and it helps a lot. We're building all our benches in ~6secs. For example, in this run: https://github.com/CodSpeedHQ/codspeed-rust/actions/runs/6160795381/job/16718554517

We use https://github.com/moonrepo/setup-rust but using any other tools it should work if you cache the release target. https://github.com/CodSpeedHQ/codspeed-rust/blob/1621b664db0e47c8a63b55b9cde64e1f7e9cdf9a/.github/workflows/ci.yml#L32-L34

Boshen commented 1 year ago

I'm using https://github.com/Swatinem/rust-cache due to the 10G GitHub cache limit.

I'll look into faster compilation methods on my end first. Thank you.

Boshen commented 1 year ago

How does the compile time compare to compiling without codspeed (using "plain" criterion)?

I quick experimentation showed the same compilation duration.