Unofficial Hacker News companion — get notified on comment replies, and more.

Optimizing Rustc's next trait solver (opens external site)

213 points by g0xA52A2A 7 days ago | donsz.nl | 48 comments on HN | Vote on HN (opens Hacker News) |

View full thread · View on Hacker News

Comment thread (2)

  1. > The C++ project doesn't depend on libc or any external libraries but that is not a practical option in rust.

    Aside from the std library (which you're not paying for in compile time because it's precompiled). Why is this different in Rust vs. C++? Sure, it's inconvenient not to use e.g. serde, but it's equally inconvenient in C++...

    Taffy (https://github.com/DioxusLabs/taffy) which is ~26k LoC + a handful of dependencies compiles in release mode in ~1.6s

    Replies (1)
    1. It is very obvious if you try to actually do something without libc in rust. It is just a major pain. You could theoretically do it but not really in practice.

      Doing `RUSTFLAGS="-C target-cpu=native" cargo install --path . --locked` on my project.

      With lto=`thin` just takes 3.6 seconds on my pc which is very bad if you compare it to the c++ project.

      Also the output binary is 1.3MB which is also supremely bad.