-
Notifications
You must be signed in to change notification settings - Fork 531
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
Intersection is too slow for case class with more than 6 fields #793
Comments
Have you tried TLS with |
@milessabin have tried but the situation almost isn't changed, it still takes ages. For example, 37 seconds for 7 fields and 108 seconds for 8 fields. I haven't got result for 9 fields |
@sergeygrigorev a lot of fields is not enough to make it slow. Your example above compiles in a few seconds. I think the worst case would be to have a lot of fields of different types in reverse order. Like so: case class C1(f1: Byte, f2: Short, f3: Char, f4: Int, f5: Long, f6: Float, f7: Double, f8: String)
case class C2(f1: String, f2: Double, f3: Float, f4: Long, f5: Int, f6: Char, f7: Short, f8: Byte) The problem with type level programming is that you can do mostly naive algorithms and often end up with quadratic worst case complexity. |
Should we close this issue as PR as well? |
Fixed by #682 |
So, shapeless.ops.hlist.Intersection takes too much time to compile. In my case it's impossible to wait for a case class with 10 fields. But for a test only - 6 and 7 fields also takes too much time.
In my case of course classes is a little different, it's just a test case. Is there any compiler optimization to pass this problem?
The text was updated successfully, but these errors were encountered: