scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
232 stars 21 forks source link

Unify Scala hashing algorithms #10084

Open scabug opened 7 years ago

scabug commented 7 years ago

The hashing algorithms in FlatHashTable and HashTable differ from HashMap and HashSet - and we probably have other variants also.

They should be unified, since HashTable explicitly deprecated the methods used in other places.

See https://issues.scala-lang.org/browse/SI-10049?focusedCommentId=75931 for further details.

scabug commented 7 years ago

Imported From: https://issues.scala-lang.org/browse/SI-10084?orig=1 Reporter: @paplorinc

magnolia-k commented 5 years ago

Since the FlatHashTable is deleted by the following commit, can this issue be closed?

https://github.com/scala/scala/commit/3a6f637b33056df80b93e743fe274f623925ea21

SethTisue commented 5 years ago

the “we probably have other variants also” part gives me pause — @szeiger @Ichoran @julienrf wdyt?

eed3si9n commented 5 years ago
szeiger commented 5 years ago

The title is a bit misleading. It's not really about different hashing algorithms (we use .## or .hashCode everywhere) but about improving hashes and mapping them to hash buckets. We still have different algorithms in mutable and immutable hash-based collections. See https://github.com/scala/bug/issues/11326 for a related discussion.

magnolia-k commented 5 years ago

If the issue is that the right hash algorithm has been chosen, is it better to close the issue itself? (Or I think that rewriting the title ... unifying is not the point of discussion)