Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I really disagree here: I'm a maintainer of a medium sized open source Rust project [1] and I'm always surprised by Rust compilation time speed (local). On a MacBook Pro, it's a matter of seconds, in debug. Release compilation and CI/CD are slower, but, since the beginning of my Rust journey (2 years ago), Rust compilation seems just very fa...

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



https://github.com/grapl-security/grapl/

I just did a clean build `cargo build`, 19 minutes 44 seconds.

I added 1 line (`dbg!("foo")`) and it took 14.76s


In grapl/src/rust:

- 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).


Yes, it'll require a protoc installation to actually compile, as well as some native dependencies.

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.


MBP M2 Max building hurl from clean:

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!


21.33s on my iMac Pro (Xeon-2150B, 10 core / 20 thread). Unoptimized.

Optimized: 1m 25s




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: