I just did a clean build `cargo build`, 19 minutes 44 seconds.
I added 1 line (`dbg!("foo")`) and it took 14.76s
- cloc shows that there are ~70,000 lines of Rust
- with `cargo tree`, I see that the project depends on ~600 crates
In my toy project:
- cloc shows that there are ~40,000 lines of Rust
- with `cargo tree`, I see ~40 crates
I don't know the scope of grapl, but 600 (transitives) crates seems a lot to me. Maybe that explains why this particular build is so long. I haven't managed to build it (seems to have prerequisites on proto buffer stuff).
Naturally more crates means more time on compilation. Grapl is a pretty large project, lots of services that do different things, so it isn't too surprising that it has a lot of dependencies relative to what I assume is a more tightly scoped project.
For example, Grapl talks to multiple different databases, AWS services, speaks HTTP + JSON and gRPC (with protobuf), has a cli, etc etc.
Optimized: 1m 25s
cargo build 42.55s user 4.35s system 748% cpu 6.269 total
cargo build --release 99.38s user 4.13s system 267% cpu 38.660 total
(I can really recommend this box for Rust. I got it in August, should have waited for M3...)
Kudos for making hurl, it looks super-userful!
To balance / explain my point:
- my day work is Java / Kotlin with Gradle. Now, we can talk about glacial compilation times
- on my open source Rust project, we try to minimise dependencies, don't use macros (apart derive[Debug, Clone] etc...), and have a very moderate generics usage
If you take the time to `cargo build` my project, I'll be happy to have feedbacks on compilation times
[1]: https://github.com/Orange-OpenSource/hurl