-
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
1 million item array spends inordinate time on error path of typechecking #137678
Comments
How did you deduce that the time is spent in formatting? |
If I make it not produce a diagnostic then it doesn't take minutes. I may be using a "format" more generically than you would, but outputting the diagnostic is as good as instant, so formatting -- preparing data to output -- must be the only other step. You probably have established nomenclature for this. |
"make it not produce a diagnostic"? what do you mean? |
If I fix the error it doesn't produce the diagnostic and takes 32s. Writing the diagnostic takes approximately 0 time, therefore formatting the diagnostic takes at least 2:12-0:32=1:40. I believe it probably shouldn't take this long, and it would've been better for it to have taken 32s and produce just a type-level diagnostic. |
Hm. Are you sure this "formatting" of the diagnostic is not something like, for instance, the typechecker not being able to quickly solve the problem "what is the type of this?" and then examining the entire array to determine if there is a type it can coerce the entire array to and then attempting to apply a coercion to the entire array to interpret the type as something else and seeing if then it would resolve to something with the correct type? |
No, but that's my best guess based on what I saw. Can I dump the stage timings somehow?
|
Code
(The actual data is for indices in a 100³ gilbert curve but isn't relevant here.)
this is the good state
Change line 2 to
to trigger
Current output
Desired output
Rationale and extra context
I think in this case (and in general) having rustc churn for two full minutes is. Not good. And value to the user is bigger when you get the error without source-level diagnostics.
Rust Version
The text was updated successfully, but these errors were encountered: