Skip to content
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

Namers - no duplicates: backport changes to avoid allocations [nomerge] #7820

Merged
merged 1 commit into from
Mar 12, 2019

Conversation

diesalbla
Copy link
Contributor

Picks up from #7811

We backport to 2.12.x some changes from the PR #6218, on the code to detect duplicates in the import selectors. These changes help us to avoid allocating two extra lists due to the use of the map functions.

We "backport", but with some changes, the improvements to the
`noDuplicates` function already introduced in the 2.13.x branch.
Importantly, this avoids the allocation of two mapped lists.
@scala-jenkins scala-jenkins added this to the 2.12.9 milestone Mar 6, 2019
@diesalbla diesalbla changed the title Selectively Backport some changes Namers - no duplicates: backport changes to avoid allocations Mar 6, 2019
selectors foreach checkSelector

def noDuplicates(): Unit = {
@inline def isRename(hd: ImportSelector): Boolean =
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In 2.13.x, this is a method of the ImportSelector class, but I do not want to change any API in 2.12.x.

@retronym retronym added the performance the need for speed. usually compiler performance, sometimes runtime performance. label Mar 8, 2019
@diesalbla diesalbla changed the title Namers - no duplicates: backport changes to avoid allocations Namers - no duplicates: backport changes to avoid allocations [nomerge] Mar 8, 2019
@retronym retronym merged commit f693037 into scala:2.12.x Mar 12, 2019
@diesalbla diesalbla deleted the dedup_no_lists_backport branch March 12, 2019 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance the need for speed. usually compiler performance, sometimes runtime performance.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants