You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the test suite for the mongodb crate, we included a large number of #[async_trait] implementations, and this lead to roughly 1 minute of compile type for any incremental change to the tests (via cargo check --tests). Using -Zself-profile, it was determined that nearly all of this time was spent in evaluate_obligation. After converting all of the #[async_trait]s and their implementations to vanilla traits that returned BoxFuture manually, the evaluate_obligation portion of the compilation time was almost completely eliminated.
I'm not sure if this is a bug in the implementation of async_trait or simply a limitation of doing macro-based traits, but I figured it was worth reporting here. Let me know if there's any more useful information I can provide.
The text was updated successfully, but these errors were encountered:
In the test suite for the
mongodb
crate, we included a large number of#[async_trait]
implementations, and this lead to roughly 1 minute of compile type for any incremental change to the tests (viacargo check --tests
). Using-Zself-profile
, it was determined that nearly all of this time was spent inevaluate_obligation
. After converting all of the#[async_trait]
s and their implementations to vanilla traits that returnedBoxFuture
manually, theevaluate_obligation
portion of the compilation time was almost completely eliminated.For more context, see rust-lang/rust#87012 (comment).
I'm not sure if this is a bug in the implementation of
async_trait
or simply a limitation of doing macro-based traits, but I figured it was worth reporting here. Let me know if there's any more useful information I can provide.The text was updated successfully, but these errors were encountered: