Post
All that proc-macro was doing though is `quote!`ing a bunch, not much more. So I spent the day rewriting the implementation of TokenStream used by the server to make use of an immutable shared tree instead to get super cheap concatenations.
0 reposts36 likes
And sure enough, this changed the 8 second expansion time into a 100ms! A bit more info can be found in the PR description here github.com/rust-lang/ru.... This should improve general speed of rust-analyzer in the majority of projects given how pervasive these kinds of macros are in Rust.
You can sponsor my work on rust-analyzer by the way :) github.com/sponsors/Vey...
Thanks! Funnily enough the macros in Zed themselves aren't really that problematic. They don't do a lot of quote!ing so they are mostly fine. Except for the `derive_inspector_reflection` which I straight up disabled for r-a's analysis because it took like 16 seconds alone github.com/zed-industri...