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 AsyncAwait-Triaged I-compiletime P-medium T-compiler

Comments

@nikomatsakis
Copy link
Contributor

@nikomatsakis nikomatsakis commented Apr 17, 2020

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 T-compiler labels Apr 17, 2020
@nikomatsakis
Copy link
Contributor Author

@nikomatsakis nikomatsakis commented Apr 17, 2020

cc @sfackler, author of #70831

@jonas-schievink jonas-schievink added the I-compiletime label Apr 17, 2020
@sfackler
Copy link
Member

@sfackler sfackler commented Apr 17, 2020

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 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 I-prioritize labels Apr 21, 2020
@tmandry
Copy link
Contributor

@tmandry 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

@spastorino spastorino commented Apr 21, 2020

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

@spastorino spastorino added P-medium and removed I-prioritize 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 AsyncAwait-Triaged I-compiletime P-medium T-compiler
Projects
None yet
Development

No branches or pull requests

6 participants