Discussion
Loading...

Discussion

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Esteban Küber :rust:
@ekuber@hachyderm.io  ·  activity timestamp 2 days ago

There are at least three separate things that rustc and cargo could do to significantly improve compilation speed, but they are complex engineering efforts that require a lot of development time and engineers working on them full-time for that period.

Off the top of my head they are:
• doing what zig does to compile only items that are reachable, which requires making rustc reentrant to stop after name resolution and cargo more complex to pass used item paths through subsequently to pick up after name resolution for the entire projects dependency tree has been computed,
• leveraging an incremental linker and have rustc only codegen the binary patch instead of the whole binary and have the linker calculate the patch,
• and caching proc-macros and treat them as idempotent (likely as opt-in)

There are of course others, like pre-compiled cratedistribution, better intra-rustc parallelism or feature cfg handling, but those have more open questions and require additional design work before I could claim they're attainable in a reasonable amount of time.

#RustLang #Rust

  • Copy link
  • Flag this post
  • Block
Georg Semmler
@weiznich@social.weiznich.de replied  ·  activity timestamp 2 days ago

@ekuber I believe there are also more specific things that can have a large impact on certain patterns. For example I remember performance profiles of rustc compiling diesel code and a lot of time (>30%) was spend evaluating trait bounds for tuples, often going from a large tuple to a smaller one, starting the same thing again. Having better caching there could help crates like diesel, bevy or axum. Maybe just something trait impl on a tuple generated by a macro and caches based on that?

  • Copy link
  • Flag this comment
  • Block
Esteban Küber :rust:
@ekuber@hachyderm.io replied  ·  activity timestamp 2 days ago

If you want to see what is currently being worked on, check out https://rust-lang.github.io/rust-project-goals/

  • Copy link
  • Flag this comment
  • Block
Ed Page
@epage@hachyderm.io replied  ·  activity timestamp 2 days ago

@ekuber

> and caching proc-macros and treat them as idempotent (likely as opt-in)

Or declarative attribute and derive macros so you don't need to build the proc-macro machinery

  • Copy link
  • Flag this comment
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.0 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login