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

Special case quote!/quote_spanned! for 1 and 2 tts. #217

Merged
merged 1 commit into from Apr 11, 2022

Conversation

nnethercote
Copy link
Contributor

These make crates that use quote compile faster.

I also tried specializing for 3 tts, but the rules are more complex and
the additional perf wins are much smaller than they are for 1 and 2 tts.

@nnethercote
Copy link
Contributor Author

nnethercote commented Apr 7, 2022

Some instruction counts results for non-incremental cargo check builds on some crates that use quote heavily.

Benchmark Profile Scenario % Change Significance Factor?
ctor-0.1.21 check full -12.39% 61.93x
num-derive-0.3.3 check full -11.05% 55.26x
pest_generator-2.1.3 check full -11.02% 55.11x
enum-as-inner-0.4.0 check full -9.73% 48.67x
mockall_derive-0.11.0 check full -6.63% 33.17x
futures-macro-0.3.19 check full -5.82% 29.12x
wasm-bindgen-backend-0.2.79 check full -4.44% 22.20x
wayland-scanner-0.29.4 check full -3.75% 18.75x
pyo3-macros-backend-0.16.3 check full -2.37% 11.83x
tonic-build-0.7.0 check full -2.34% 11.68x
clap_derive-3.1.7 check full -2.16% 10.78x
prost-derive-0.10.0 check full -2.16% 10.78x
ref-cast-impl-1.0.6 check full -1.95% 9.74x
diesel_derives-1.4.1 check full -1.84% 9.20x
stdweb-derive-0.5.3 check full -1.58% 7.88x
vsdb_derive-0.21.1 check full -1.01% 5.05x
enumflags2_derive-0.7.4 check full -0.08% 0.40x

src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
Copy link
Owner

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks promising.

The failing ui test should be fixed if you rebase past 31c3be4. Rustc's diagnostics sometimes change.

Edit: nope, that isn't it. This PR is causing the diagnostic change. You can run TRYBUILD=overwrite cargo +nightly test --test compiletest to update the test case.

@nnethercote nnethercote force-pushed the special-case-1-2 branch 2 times, most recently from 42fa703 to 9a2530a Compare April 11, 2022 03:47
@nnethercote
Copy link
Contributor Author

CI gets one test error, but I get two locally -- the second one in tests/ui/not-repeatable.stderr. Not sure why. I have pushed a new version that updates the expected output just for tests/ui/not-quotable.rs. Hopefully that'll be enough to satisfy CI.

These make crates that use `quote` compile faster.

I also tried specializing for 3 tts, but the rules are more complex and
the additional perf wins are much smaller than they are for 1 and 2 tts.
@nnethercote
Copy link
Contributor Author

Whoops, no, I pushed a version with both test changes. This time it should just be the one change.

Copy link
Owner

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dtolnay dtolnay merged commit 2d23d9d into dtolnay:master Apr 11, 2022
@nnethercote nnethercote deleted the special-case-1-2 branch April 11, 2022 04:34
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

Successfully merging this pull request may close these issues.

None yet

2 participants