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

perf slowdown from #70831 (remove a stack frame from .await calls) #71244

Open
nikomatsakis opened this issue Apr 17, 2020 · 5 comments
Open
Labels
A-async-await Area: Async & Await AsyncAwait-Triaged Async-await issues that have been triaged during a working group meeting. I-compiletime Issue: Problems and improvements with respect to compile times. P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@nikomatsakis
Copy link
Contributor

Post-merge perf results are 100% restricted to await-call-tree, and it's more clearly >1% now, post-rust-lang/rustc-perf#645 (cc @Mark-Simulacrum).

Presumably we consider that test a stress test and we're fine with the 1-5% slowdown?
cc @rust-lang/wg-async-foundations

Originally posted by @eddyb in #70831 (comment)

@nikomatsakis nikomatsakis added A-async-await Area: Async & Await T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 17, 2020
@nikomatsakis
Copy link
Contributor Author

cc @sfackler, author of #70831

@jonas-schievink jonas-schievink added the I-compiletime Issue: Problems and improvements with respect to compile times. label Apr 17, 2020
@sfackler
Copy link
Member

It does seem a bit strange to me that there's a slowdown here - the complexity of the overall code post expansion seems like it should be just about the same as before, right?

@eddyb
Copy link
Member

eddyb commented Apr 17, 2020

IIRC, a poll_with_context call was replaced with two calls, to Future::poll and get_context.

That would presumably double type-checking time in an .await-heavy function.

I'm actually a bit surprised all of the unsafety (i.e. get_context) isn't contained entirely in the HIR lowering, but I suppose there's several casts involved.

@tmandry tmandry added AsyncAwait-Triaged Async-await issues that have been triaged during a working group meeting. I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Apr 21, 2020
@tmandry
Copy link
Member

tmandry commented Apr 21, 2020

Context for wg-prioritization: here's the benchmark. It's sort of a stress test, but not an unrealistic one in that it only goes 7 levels deep (I'm sure we have some call trees that deep, and maybe with a 3x factor, in Fuchsia, but only a few).

@spastorino
Copy link
Member

Assigning P-medium as discussed as part of the Prioritization Working Group process and removing I-prioritize.

@spastorino spastorino added P-medium Medium priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-async-await Area: Async & Await AsyncAwait-Triaged Async-await issues that have been triaged during a working group meeting. I-compiletime Issue: Problems and improvements with respect to compile times. P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants