-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix #20521: Optimise caching for computing atoms and widened in OrTypes #21223
Conversation
test performance please |
performance test scheduled: 1 job(s) in queue, 1 running. |
Performance test finished successfully: Visit https://dotty-bench.epfl.ch/21223/ to see the changes. Benchmarks is based on merging with main (a046b00) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense and seems like a safe change. Nicely found.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable, and great that it helped performance!
Fix #20521
When using the
atoms
of a large provisional union type, significant time is wasted computing the widened type andlub
is invoked repeatedly. This PR addresses this issue by splitting the caching mechanisms for computingatoms
and computing the widened type inOrType
.As a result of this optimization, the compilation time for
tests/pos/i20521.scala
has been reduced from approximately 40 seconds to 6 seconds, making it comparable to Scala 2's performance.