• asdfasdfasdf@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    20 hours ago

    Yeah I doubt it. I’ve worked in large Rust codebases too. I’d do some benchmarking. Cargo has some nice flags that let you see exactly what it’s doing. You can open the compilation report up in a browser and zoom in on different steps of the process and see everything.

      • ISO@lemmy.zip
        link
        fedilink
        arrow-up
        4
        ·
        18 hours ago

        Make sure you’re using a fast linker. Although I think lld is the default now, so that should be less of a concern these days. But see if mold or wild would help.

        More relevantly, you should be using cranelift for codegen in dev builds.

        If you have codegen-units = 1 in your release profile, make sure you have a separate dev profile that doesn’t.

        If you still experience decapitating slowness (doubtful), and it’s actually the rust compiler being slow (super doubtful), you can try the parallel frontend. Apparently there are almost™ no bugs left in its implementation (It’s one of the project priorities now).

        Needless to say, but you should be checking your --timings to really know what’s going on.

          • ISO@lemmy.zip
            link
            fedilink
            arrow-up
            1
            ·
            1 hour ago

            It would be a cool if you report back in a separate post if you discovered anything interesting. It’s not like we’re overwhelmed by too much activity here.

            Also, while I think it should be obvious, but I forgot to clarify that if you’re inheriting from a profile with codegen-units = 1, then you need to set that explicitly to a higher value in the inheriting profile.

        • MangoCats@feddit.it
          link
          fedilink
          English
          arrow-up
          1
          ·
          17 hours ago

          The various linkers do make a difference, but all of them choke, eventually, when individual files get too massive.