-
Notifications
You must be signed in to change notification settings - Fork 790
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
Tupled Type Test Pattern Matching caused exponential IL growth #5212
Labels
Milestone
Comments
@manofstick Thanks, good report. |
This is similar, and essentially the same as what happens with the IL in #4691, I think. FWIW, this behavior can also be seen with nested/tupled DUs, not just type test patterns. |
manofstick
added a commit
to manofstick/visualfsharp
that referenced
this issue
Jun 25, 2018
manofstick
added a commit
to manofstick/visualfsharp
that referenced
this issue
Aug 7, 2018
manofstick
added a commit
to manofstick/visualfsharp
that referenced
this issue
Aug 7, 2018
manofstick
added a commit
to manofstick/visualfsharp
that referenced
this issue
Aug 7, 2018
manofstick
added a commit
to manofstick/visualfsharp
that referenced
this issue
Aug 8, 2018
manofstick
added a commit
to manofstick/visualfsharp
that referenced
this issue
Aug 12, 2018
This was fixed by recent improvements to pattern compilation |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following functions demonstrate the affect:
So type size of the Il generated from those functions is 60, 143, 337 bytes respectively.
The array checking code in
prim_types.fs
in the funcitonGenericEqualityObj
which has 8 type-checks creates IL which is around 8K.Expected behavior
This should be a linear increase.
Actual behavior
The exponential behaviour is due to the AST duplicating the remaining code in both the first and second failing check.
Known workarounds
You can work around this by putting a catch all, and then matching again.
In the
prim_types
code this would look like this:The text was updated successfully, but these errors were encountered: