-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #12241: Make space computation lazy #12271
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
This corner case optimization is unsafe and no code depends on it.
test performance with #exhaustivity please |
performance test scheduled: 1 job(s) in queue, 0 running. |
Performance test finished successfully: Visit https://dotty-bench2.epfl.ch/12271/ to see the changes. Benchmarks is based on merging with master (4e8ca78) |
Performance test finished successfully: Visit https://dotty-bench.epfl.ch/12271/ to see the changes. Benchmarks is based on merging with master (4e8ca78) |
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.
Otherwise, LGTM
def dedup(spaces: Seq[Space])(using Context): Seq[Space] = | ||
if (spaces.lengthCompare(1) <= 0 || spaces.lengthCompare(10) >= 0) spaces | ||
else { | ||
val res = spaces.map(sp => (sp, spaces.filter(_ ne sp))).find { |
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.
I wonder if it would help performance if we do not compute spaces.filter(_ ne sp)
eagerly.
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.
Here spaces
has a size < 10, so should not matter much.
The newly added test does get json data (from Chrom inspector): [
[12271,"2021-04-29T12:36:56+0200","16a622fd1b",903.4235,846.695],
[12271,"2021-04-29T13:16:47+0200","16a622fd1b",871.691,831.192],
[12271,"2021-04-29T13:51:41+0200","16a622fd1b",955.0745,835.253],
[12271,"2021-04-29T14:26:22+0200","16a622fd1b",950.573,842.552]
] The UI does not show them due to too few points (need to improve the JavaScript). |
Fix #12241: Make space computation lazy