Loading classes with many methods is very expensive
Peter Levart
peter.levart at gmail.com
Thu Oct 30 09:43:20 UTC 2014
On 10/30/2014 10:29 AM, Peter Levart wrote:
> I might get away with excluding seq from hashCode computation and only
> use it in equals(). This way Key(s) could be modified in-place
> (hashCode would not change, entry would stay in same bucket), it would
> just become equal to some other Key. Modification operations would
> keep the invariant that there are no duplicate Key(s) at any time in
> the Map. All entries sharing same method signature would end-up in the
> same bucket (and maybe share it with entries that just happen to have
> the same hashCode mod capacity) and we would get a similar linked list
> of entries as with previous approach - only without another level of
> indirection...
That would not work. I would have to have the Key object accessible.
Since Map does not have a getKey(key) operation, I would have to store
the Key as a value too. And we're back to MethodList approach...
Peter
More information about the core-libs-dev
mailing list