Skip to content

Fix #10573: Devirtualize member selection when matching #10576

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 1 commit into from
Dec 7, 2020

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

@nicolasstucki
Copy link
Contributor Author

test performance with #quotes please

@dottybot
Copy link
Member

dottybot commented Dec 1, 2020

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

@nicolasstucki nicolasstucki marked this pull request as ready for review December 1, 2020 11:40
Copy link
Contributor

@liufengyun liufengyun 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


devirtualizedScrutinee == pattern
|| summon[Env].get(devirtualizedScrutinee).contains(pattern)
|| devirtualizedScrutinee.allOverriddenSymbols.contains(pattern)
Copy link
Contributor

@liufengyun liufengyun Dec 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation of the method needs to be updated. The following code might be faster:

scrutinee.overridingSymbol(pattern.owner) == pattern
|| pattern.overridingSymbol(scrutinee.owner) == scrutinee

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will try that. The current performance is unaccepable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overridingSymbol worked, but not there.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the check is whether the two symbols override each other, can we simply replace the body of the method with the following:

scrutinee.overridingSymbol(pattern.owner) == pattern
|| pattern.overridingSymbol(scrutinee.owner) == scrutinee

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That version had some false positives involving modules.

@dottybot
Copy link
Member

dottybot commented Dec 1, 2020

Performance test finished successfully:

Visit http://dotty-bench.epfl.ch/10576/ to see the changes.

Benchmarks is based on merging with master (90f44d4)

@nicolasstucki
Copy link
Contributor Author

test performance with #quotes please

@dottybot
Copy link
Member

dottybot commented Dec 1, 2020

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

@nicolasstucki
Copy link
Contributor Author

test performance with #quotes please

@dottybot
Copy link
Member

dottybot commented Dec 1, 2020

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

@nicolasstucki
Copy link
Contributor Author

@liufengyun the benchmarks might be stuck

@liufengyun
Copy link
Contributor

Yes, I stopped it, I am investigating the latest failures.

@nicolasstucki
Copy link
Contributor Author

test performance with #quotes please

@dottybot
Copy link
Member

dottybot commented Dec 3, 2020

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

@dottybot
Copy link
Member

dottybot commented Dec 3, 2020

Performance test finished successfully:

Visit http://dotty-bench.epfl.ch/10576/ to see the changes.

Benchmarks is based on merging with master (bbdbdf2)

@nicolasstucki
Copy link
Contributor Author

Now performance is fine

Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The document for symbolMatch needs to be updated. Otherwise, LGTM

@nicolasstucki nicolasstucki merged commit d8cb977 into scala:master Dec 7, 2020
@nicolasstucki nicolasstucki deleted the fix-#10573 branch December 7, 2020 07:56
@Kordyjan Kordyjan added this to the 3.0.0 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.

4 participants