diff options
author | Martin Odersky <odersky@gmail.com> | 2014-02-19 11:08:29 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-02-21 18:42:50 +0100 |
commit | 2633300305df2cc40142d287cb715c3bd8561fc8 (patch) | |
tree | 2cf4146fa24a81edcd6ca8496bbadef3a133d50b /src | |
parent | d0568c1a5717a6adc22f74b93552394a9c4c586f (diff) | |
download | dotty-2633300305df2cc40142d287cb715c3bd8561fc8.tar.gz dotty-2633300305df2cc40142d287cb715c3bd8561fc8.tar.bz2 dotty-2633300305df2cc40142d287cb715c3bd8561fc8.zip |
Drop unique hashing for superId bitsets
Reason: (1) There are few sets: When compiling doty itself, 1.2K sets total, hashed to 500 uniques. (2) Bitset comparison is expensive because it relies on a double inclusion test. (This should be fixed in the Scala stdlib).
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/core/Contexts.scala | 7 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/SymDenotations.scala | 2 |
2 files changed, 1 insertions, 8 deletions
diff --git a/src/dotty/tools/dotc/core/Contexts.scala b/src/dotty/tools/dotc/core/Contexts.scala index c7e0784c8..859475cd5 100644 --- a/src/dotty/tools/dotc/core/Contexts.scala +++ b/src/dotty/tools/dotc/core/Contexts.scala @@ -420,13 +420,6 @@ object Contexts { lastSuperId } - // SymDenotations state - /** A table where unique superclass bits are kept. - * These are bitsets that contain the superclass ids of all base classes of a class. - * Used to speed up isSubClass tests. - */ - private[core] val uniqueBits = new util.HashSet[BitSet]("superbits", 1024) - // Types state /** A table for hash consing unique types */ private[core] val uniques = new util.HashSet[Type]("uniques", initialUniquesCapacity) { diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index 1bb912059..b377817f9 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -872,7 +872,7 @@ object SymDenotations { to } myBaseClasses = classSymbol :: addParentBaseClasses(classParents, Nil) - mySuperClassBits = ctx.uniqueBits.findEntryOrUpdate(seen.toImmutable) + mySuperClassBits = seen.toImmutable } /** A bitset that contains the superId's of all base classes */ |