Remix.run Logo
▲ treyd a day 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).

▲packetlost a day ago | parent | next [-]

Also procmacros add quite a bit of overhead to builds

▲norman784 12 hours ago | parent [-]

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)

▲packetlost 12 hours ago | parent [-]

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.

▲dboreham a day ago | parent | prev [-]

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