Skip to content

Avoid pickling the same position multiple times #3828

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
Jan 15, 2018

Conversation

smarter
Copy link
Member

@smarter smarter commented Jan 14, 2018

Decreases the size of the bootstrapped dotty-compiler jar from 8662 KB
to 8647 KB.

@smarter smarter requested a review from odersky January 14, 2018 02:43
@@ -19,7 +19,7 @@ class PositionPickler(pickler: TastyPickler, addrOfTree: tpd.Tree => Option[Addr
import buf._
import ast.tpd._

private val remainingAddrs = new java.util.IdentityHashMap[Tree, Iterator[Addr]]
private val pickledIndices = new mutable.HashSet[Int]
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe use a bitset

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, this looks ideal for a BitSet, since it is bounded and fairly dense.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Decreases the size of the bootstrapped dotty-compiler jar from 8662 KB
to 8647 KB.
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

@smarter smarter merged commit d8b72b2 into scala:master Jan 15, 2018
@allanrenucci allanrenucci deleted the pickle-less-pos branch January 16, 2018 07:54
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