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
Allegedly faster HashSet implementation #2512
Comments
Imported From: https://issues.scala-lang.org/browse/SI-2512?orig=1
|
@paulp said: [scalacfork] *** Cumulative statistics at phase cleanup
[...]
[scalacfork] #uniquetypes : 2242323
[scalacfork] #uniquetypes2: 962323 Sadly no performance improvement that I can see, but maybe that's because I'm nowhere near memory bound. I'll fix it shortly. |
@paulp said: |
Eric Willigers (ewilligers) said: |
@paulp said: |
Eric Willigers (ewilligers) said: |
Eric Willigers (ewilligers) said: Running my attached benchmark, my suggested hashset takes 30% to 40% less time. I used Scala 2.8.0.r19890-b20091126020351 and Java 1.7.0-ea-b76 on XP |
@ijuma said: |
@paulp said:
If I finish up #2537 then it will be true, because for the big cases in the compiler what is being stored in HashSet are case classes. |
@ijuma said: Interesting that the compiler uses case classes that much. For maps in Java, the statistics I've seen say that over 50% uses a String key. |
@paulp said: |
@Ichoran said: |
@kanielc said: |
@SethTisue the initial bug was fixed, hashes improved, no definitive reproducible demonstration of an issue with 2.13 collections. No one is crying "my small AnyRefMap is slow". Suggest closing with your friendly, Happy to re-open if someone discovers an issue. Alternatively, transfer the issue to collections-next for dotty to inherit after the thaw. |
scala.tools.nsc.util.hashSet.growTable() should set
when allocating the new Array.
With the current implementation, a hashSet with 16 entries reports size 48 and has capacity 256.
With the proposed fix, it would report size 16 and have capacity 128.
Here's an example of the value of the memory saving: when attempting to compile an existing program with truck (-Xmx1312M on Win XP) I experience outOfMemoryError: Java heap space
The text was updated successfully, but these errors were encountered: