Hacker News new | ask | show | jobs
by matesz 881 days ago
I highly recommend checking out makepad [1] - they have +100k of rust code and the compile time is around 10-15 seconds on commodity hardware.

However they are obsessed about performance. They reason for such speedy compile times is that makepad almost has no dependencies.

[1] https://github.com/makepad/makepad/

2 comments

IMHO Makepad also has an exceptionally readable Rust code style, which is a very rare thing (maybe that simple Rust style even contributes to the good build times, dunno) - but also: from the pov of a C programmer, 200 kloc in 10..15 seconds is still quite bad ;)
How quickly can you verify the memory safety of that C program in addition to compiling it though? When comparing like to like, C no longer looks so fast.
Rust code with unsafe still compiles slowly. And safe subsets of C still compile quickly.
That is exactly the opposite of my experience.
I used actix web, could it be the reason for slow compile?
I am not completely sure, but I think pretty much all frameworks in Rust have complex dependencies and codebase not optimized for fast compile times. You could check out Axum [1], at the first glance seems similar to actix [2]. Both use tokio which is by itself pretty big I think.

Folks at makepad poured enormous effort in keeping dependency graph minimal.

[1] https://github.com/tokio-rs/axum/

[2] https://github.com/actix/actix-web/