Skip to content

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

Merged
merged 7 commits into from
Apr 29, 2021

Conversation

liufengyun
Copy link
Contributor

Fix #12241: Make space computation lazy

@liufengyun
Copy link
Contributor Author

test performance with #exhaustivity please

@dottybot
Copy link
Member

performance test scheduled: 1 job(s) in queue, 0 running.

@dottybot
Copy link
Member

Performance test finished successfully:

Visit https://dotty-bench2.epfl.ch/12271/ to see the changes.

Benchmarks is based on merging with master (4e8ca78)

@liufengyun
Copy link
Contributor Author

test performance with #exhaustivity please: 16a622f 16a622f 16a622f

@dottybot
Copy link
Member

performance test scheduled for 16a622f 16a622f 16a622f: 1 job(s) in queue, 0 running.

@dottybot
Copy link
Member

dottybot commented Apr 29, 2021

Performance test finished successfully:

Visit https://dotty-bench.epfl.ch/12271/ to see the changes.

Benchmarks is based on merging with master (4e8ca78)

Copy link
Contributor

@nicolasstucki nicolasstucki left a 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 {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@liufengyun
Copy link
Contributor Author

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).

@liufengyun liufengyun merged commit 123e538 into scala:master Apr 29, 2021
@liufengyun liufengyun deleted the fix-12241 branch April 29, 2021 15:38
@Kordyjan Kordyjan added this to the 3.0.1 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compiler loops when compiling a pattern match with a large number of patterns
4 participants