-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Compiling simple (but long) code with lots of async
/await
takes hours
#72837
Comments
async
/await
takes hoursasync
/await
takes hours
According to Instruments, the heaviest trace is
with a weight of 100%. |
@jonas-schievink I just killed the compiler. It took 45Gb RAM, so this probably also deserves an |
Single-file repro: https://gist.github.com/jonas-schievink/46fa39d98bec27c9e29314df1a8797f2 |
Self profiling output of that gist:
It's not responsible for most of the slowdown here, but |
This seems to result in extremely complex types that take a long time to process (some generator witness types contain hundreds of bound lifetimes, although they never contain more than a few dozen types each) |
That's a shame, because I was planning to build code with millions of nodes, instead of just a hundred :) More seriously, I think that this use case makes sense, too. Also, I feel that there is no good workaround at the moment. |
So I'm not sure what the best long-term fix is but I was wondering about possible workarounds. If the |
Assigning |
@tmandry is this on @rust-lang/wg-async 's radar still? |
Visited during T-compiler P-high review: cc @rust-lang/wg-async: hi WG-async do you know about if there's any changes in this area? Readjusting to P-medium for now because the repro seems to involve deeply nested types and not sure if there's a good long-term fix. |
This builds in 28 seconds now. I consider that to be acceptable. |
I attempted to compile the attached code (see z.zip).
The code is basically a bunch of
Attempting to build this with 5-10 nodes works nicely. Attempting to build this with 100 nodes... well, I gave up after 173 minutes. I looked at a second run, which took 45Gb of RAM.
Meta
Tested with
on macOS 10.15.5 (19F96) on a 8 cores macBook Pro.
Notes
The problem appears even without the dependency to crate
futures
. It's just not correct wrt borrow checking.The text was updated successfully, but these errors were encountered: