Hacker News new | ask | show | jobs
by treyd 16 days ago
The borrowchecker is not the source of the bulk of the language's slowness. It takes a fairly small fraction of the total time, I think I remember the number was 5%-15% depending on the project.

The majority of time is spent between the trait solver and LLVM optimization passes. There is work being done to improve the trait solver and to produce more efficient LLIR code from the get-go (so LLVM has less to optimize).

3 comments

Also procmacros add quite a bit of overhead to builds
Note that is so, because macros can have side effects, that was an oversight of Rust design, not having a way to have pure and impure procmacros (macro rules are pure)
It's also worse because the procmacros are themselves Rust and get compiled with the same parameters as the overall build, so if you're running a debug build the procmacros are running as debug binaries.
> and to produce more efficient LLIR code from the get-go (so LLVM has less to optimize).

I really, really want to have MIR move elimination to run even on debug builds by default. It's the #1 reason for C without optimizations to run (much) faster than Rust without optimizations, and it's terrible

You always know you're in trouble when you're profiling the compiler and you're just a user of that compiler...