• unique_hemp@discuss.tchncs.de
    link
    fedilink
    arrow-up
    7
    ·
    3 days ago

    Off the top of my head the compiler is slow because:

    1. With C you can compile every file in parallel, in Rust compilation of a single crate is serial (hence splitting up large projects into many crates is important, but that makes development somewhat more difficult)
    2. LLVM itself is pretty slow
    3. Generic functions are monomorphized (there’s a unique machine code version of it for every concrete type combination they are called with) to improve runtime performance, but that gives LLVM a lot more work to do - see point 2