Skip to content

Reduce allocations when loading packages from classpath #9587

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 6 commits into from
Aug 20, 2020

Conversation

liufengyun
Copy link
Contributor

Reduce allocations when loading packages from classpath

This is a port of the following PR in scalac:

scala/scala#8927

@liufengyun
Copy link
Contributor Author

test performance please

@dottybot
Copy link
Member

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

@dottybot
Copy link
Member

Performance test finished successfully:

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

Benchmarks is based on merging with master (0ff1e2a)

@liufengyun
Copy link
Contributor Author

test performance please

@dottybot
Copy link
Member

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

@dottybot
Copy link
Member

Performance test finished successfully:

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

Benchmarks is based on merging with master (6e6f67b)

Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

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

LGTM so far. I pushed another commit that uses the new method for more operations.

Correction: I tried to do that but it meant that many name operations needed a Context now, where they need none before.
So, that's problematic. Let's first see whether the additional operations termName(String), typeName(String) need to be called very often. Right now, they are, but that's because of other things that are in the queue to be optimized away. Let's see what remains.

That way we can keep Contexts out of Names.
@odersky
Copy link
Contributor

odersky commented Aug 20, 2020

I now went the other way and moved the "string slice to name" logic into Decorators. That way we can keep Names
clean of Contexts, which is a clearer architecture.

@odersky odersky merged commit 6149e92 into scala:master Aug 20, 2020
@odersky odersky deleted the class-rep-name branch August 20, 2020 11:29
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.

3 participants