-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Long compilation time for large tuples #35619
Comments
#14284 and related ones? |
Doesn't happen for me on 1.4.2. Takes a really long time and eventually starts printing (a lot). |
Still happens for me on 1.4.2. |
I confirm that this seems fixed on master from a few days ago. It takes several minutes before printing, so maybe the issue can be converted into "long compilation times for large homogeneous tuples". |
Is there a fundamental issue that makes large homogeneous tuples hard on the compiler or is this something that could plausibly be fixed with some optimization? |
With sufficient effort it can be made better, but one reason this happens is pretty straightforward to understand, and once you understand it you'll probably stop trying to use large tuples (which is a form of victory itself):
The consequence is that for a given A way to fix this is discovered if you search base's code for So, if you're interested in seeing this fixed, almost anyone can pitch in:
But of course given that the solution is to turn long tuples into Arrays, you should question why you're using tuples in the first place. |
This is partially a duplicate of the existing issues with handling StackOverflowError in a reliable way (which is not possible in general). But we should be able to fix this one fairly easily, since it is just a bad recursion design in
|
Seems fixed:
|
That is from total const-prop, but if we block that somewhat, it still mostly works, just slowly:
|
Fixed by #46843 |
Nice! |
The text was updated successfully, but these errors were encountered: