Load procedural macros asynchronously #8646
Labels
A-macro
macro expansion
C-feature
Category: feature request
E-hard
S-actionable
Someone could pick this issue up and work on it right now
Investigation in #8623 showed that switching the crate graph is slow, and procedural macro loading is a significant contributor. In particular,
https://github.com/matklad/rust-analyzer/blob/8d54fd105cbeb159c39fbc803ed45d450f0fe000/crates/proc_macro_api/src/lib.rs#L79-L82
is called on the main loop for each proc macro, and it's slow, because it reads proc-macro file to get a version, and then waits for the proc-macro server process to dlopen the file and report back.
We should move all this work off the main loop.
Plan:
to_crate_graph
return a crate graph and proc macros separatelyThe text was updated successfully, but these errors were encountered: