-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #8922: Performance tweak for space computation #8928
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
Conversation
We first substract the last pattern, usually it's a wildcard, thus speeds up computation. In computing `Prod(K, a1, a2, ..) - Prod(K, b1, b2, ..)`, if there exists one dimension that is not reducible, i.e. `a_i < a_i - b_i`, then the result is just `Prod(K, a1, a2, ..)`.
Useful for the following test: tests/run-custom-args/tuple-cons.scala
test performance please |
performance test scheduled: 1 job(s) in queue, 0 running. |
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/8928/ to see the changes. Benchmarks is based on merging with master (5154641) |
|
The S test and T test they have different ordering: the T has more general patterns at the end, while S has the general patterns at the beginning. In this PR, we process the patterns backwards, thus |
We first subtract the last pattern, usually, it's a wildcard, thus speeds up computation.
In computing
Prod(K, a1, a2, ..) - Prod(K, b1, b2, ..)
, if there exists one dimension that isnot reducible, i.e.
a_i < a_i - b_i
, then the result is justProd(K, a1, a2, ..)
.Fixes #8922, #7186