Skip to content
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

libproc_macro calls are extremely expensive #134

Closed
dtolnay opened this issue Oct 4, 2019 · 1 comment
Closed

libproc_macro calls are extremely expensive #134

dtolnay opened this issue Oct 4, 2019 · 1 comment

Comments

@dtolnay
Copy link
Owner

dtolnay commented Oct 4, 2019

Context: rust-lang/rust#65080

We should look into anything quote can do to reduce number of proc_macro calls.

For example, something like

- tokens.extend(once(TokenTree::Punct(Punct::new(...))));
- tokens.extend(once(TokenTree::Punct(Punct::new(...))));
- tokens.extend(once(TokenTree::Punct(Punct::new(...))));
+ tokens.extend(vec![
+     TokenTree::Punct(Punct::new(...)),
+     TokenTree::Punct(Punct::new(...)),
+     TokenTree::Punct(Punct::new(...)),
+ ]);

could be a big improvement to compile times downstream by reducing TokenStream::extend calls.

@dtolnay
Copy link
Owner Author

dtolnay commented Oct 4, 2019

Closing in favor of dtolnay/proc-macro2#199 since this can be fixed in proc-macro2.

@dtolnay dtolnay closed this as completed Oct 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant