-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Optimize runtime of #[cargo_test_macro]
#7146
Conversation
r? @Eh2406 (rust_highfive has picked a reviewer for you, use r? to override) |
@bors r+ |
📌 Commit 31ada89fe139b42c3060a564697b0b8f41d29706 has been approved by |
⌛ Testing commit 31ada89fe139b42c3060a564697b0b8f41d29706 with merge d0cec6306b395fc23e5f2cd2a414657354a1bcf2... |
💔 Test failed - checks-travis |
fmt needed :-( |
31ada89
to
b5b92e0
Compare
@bors: r=Eh2406 |
📌 Commit b5b92e0df2b895788a3136313aa40b4f127290f1 has been approved by |
⌛ Testing commit b5b92e0df2b895788a3136313aa40b4f127290f1 with merge bcaba3bff8d9b240fe711190a3c1c4cadb2695e3... |
0c1face
to
4deaad1
Compare
@bors: r- |
I've noticed recently that the incremental compile time for our test suite has felt like it's increased quite a bit. I think one reason is that everything has to go through `#[cargo_test_macro]` unconditionally on all incremental builds, and wow do we have a lot of tests being pumped through that macro. Instrumenting the macro a little bit shows that we spend nearly 2.5 seconds on each compilation simply executing this macro (note that it's in debug mode as well, not release since we typically don't execute tests in release mode. This commit instead drops the usage of `syn` and `quote` in favor of a "raw procedural macro" which is much more optimized for just our use case, even in debug mode. This drops the collective time spent in the macro to 0.2 seconds, even in debug mode!
4deaad1
to
8887b67
Compare
@bors: r=Eh2406 |
📌 Commit 8887b67 has been approved by |
Optimize runtime of `#[cargo_test_macro]` I've noticed recently that the incremental compile time for our test suite has felt like it's increased quite a bit. I think one reason is that everything has to go through `#[cargo_test_macro]` unconditionally on all incremental builds, and wow do we have a lot of tests being pumped through that macro. Instrumenting the macro a little bit shows that we spend nearly 2.5 seconds on each compilation simply executing this macro (note that it's in debug mode as well, not release since we typically don't execute tests in release mode. This commit instead drops the usage of `syn` and `quote` in favor of a "raw procedural macro" which is much more optimized for just our use case, even in debug mode. This drops the collective time spent in the macro to 0.2 seconds, even in debug mode!
☀️ Test successful - checks-travis, status-appveyor |
Update cargo 11 commits in e3563dbdcd2e370bc4f11d080f739d82d25773fd..d0f828419d6ce6be21a90866964f58eb2c07cd56 2019-07-16 19:22:44 +0000 to 2019-07-23 21:58:59 +0000 - Remove include/exclude glob warning. (rust-lang/cargo#7170) - Optimize lock file format for git merge conflicts (rust-lang/cargo#7070) - Set up CI with Azure Pipelines (rust-lang/cargo#7139) - Force clippy to run. (rust-lang/cargo#7157) - Work around #61440 (rust-lang/cargo#7158) - initial working version of cargo fix --clippy (rust-lang/cargo#7069) - Optimize runtime of `#[cargo_test_macro]` (rust-lang/cargo#7146) - Don't fail if we can't acquire readonly lock (rust-lang/cargo#7149) - Add support for multiple --features options (rust-lang/cargo#7084) - Fix a typo in an env var name (rust-lang/cargo#7145) - Add a way to disable all nightly tests (rust-lang/cargo#7142)
I've noticed recently that the incremental compile time for our test
suite has felt like it's increased quite a bit. I think one reason is
that everything has to go through
#[cargo_test_macro]
unconditionallyon all incremental builds, and wow do we have a lot of tests being
pumped through that macro.
Instrumenting the macro a little bit shows that we spend nearly 2.5
seconds on each compilation simply executing this macro (note that it's
in debug mode as well, not release since we typically don't execute
tests in release mode.
This commit instead drops the usage of
syn
andquote
in favor of a"raw procedural macro" which is much more optimized for just our use
case, even in debug mode. This drops the collective time spent in the
macro to 0.2 seconds, even in debug mode!