-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reduce RPC overhead for common proc_macro operations #86822
Commits on Jun 15, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 7678e6a - Browse repository at this point
Copy the full SHA 7678e6aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1793ee0 - Browse repository at this point
Copy the full SHA 1793ee0View commit details -
Configuration menu - View commit details
-
Copy full SHA for cc698dc - Browse repository at this point
Copy the full SHA cc698dcView commit details -
proc_macro: cache static spans in client's thread-local state
This greatly improves the performance of the very frequently called `call_site()` macro when running in a cross-thread configuration.
Configuration menu - View commit details
-
Copy full SHA for 8315ce9 - Browse repository at this point
Copy the full SHA 8315ce9View commit details -
proc_macro: reduce the number of messages required to create, extend,…
… and iterate TokenStreams This significantly reduces the cost of common interactions with TokenStream when running with the CrossThread execution strategy, by reducing the number of RPC calls required.
Configuration menu - View commit details
-
Copy full SHA for 29d8b9c - Browse repository at this point
Copy the full SHA 29d8b9cView commit details -
proc_macro: stop using a remote object handle for Punct
This greatly reduces round-trips to fetch relevant extra information about the token in proc macro code, and avoids RPC messages to create Punct tokens.
Configuration menu - View commit details
-
Copy full SHA for 801c77b - Browse repository at this point
Copy the full SHA 801c77bView commit details -
proc_macro: stop using a remote object handle for Group
This greatly reduces round-trips to fetch relevant extra information about the token in proc macro code, and avoids RPC messages to create Group tokens.
Configuration menu - View commit details
-
Copy full SHA for ff17109 - Browse repository at this point
Copy the full SHA ff17109View commit details -
proc_macro: stop using a remote object handle for Ident
This requires a dependency on `unicode-normalization` and `rustc_lexer`, which is currently not possible for `proc_macro`. Instead, a second `extern "C" fn` is provided by the compiler server to perform these steps from any thread. String values are interned in both the server and client, meaning that identifiers can be stringified without any RPC roundtrips without substantially inflating their size. RPC messages passing symbols include the full un-interned value, and are re-interned on the receiving side. This could potentially be optimized in the future. The symbol infrastructure will alwo be used for literals in a following part.
Configuration menu - View commit details
-
Copy full SHA for 67bd424 - Browse repository at this point
Copy the full SHA 67bd424View commit details -
proc_macro: stop using a remote object handle for Literal
This builds on the symbol infrastructure built for ident to replicate the `LitKind` and `Lit` structures in rustc within the `proc_macro` client, allowing literals to be fully created and interacted with from the client thread. Only parsing and subspan operations still require sync RPC.
Configuration menu - View commit details
-
Copy full SHA for dd916c7 - Browse repository at this point
Copy the full SHA dd916c7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6a0962f - Browse repository at this point
Copy the full SHA 6a0962fView commit details -
Try to reduce codegen complexity of TokenStream's FromIterator and Ex…
…tend impls This is an experimental patch to try to reduce the codegen complexity of TokenStream's FromIterator and Extend implementations for downstream crates, by moving the core logic into a helper type. This might help improve build performance of crates which depend on proc_macro as iterators are used less, and the compiler may take less time to do things like attempt specializations or other iterator optimizations. The change intentionally sacrifices some optimization opportunities, such as using the specializations for collecting iterators derived from Vec::into_iter() into Vec. This is one of the simpler potential approaches to reducing the amount of code generated in crates depending on proc_macro, so it seems worth trying before other more-involved changes.
Configuration menu - View commit details
-
Copy full SHA for fea1d01 - Browse repository at this point
Copy the full SHA fea1d01View commit details