[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-smalltalk] Re: Dictionary>>#addAll: fails
From: |
Stephen Compall |
Subject: |
[Help-smalltalk] Re: Dictionary>>#addAll: fails |
Date: |
Thu, 29 Mar 2007 16:35:24 -0500 |
On Mon, 2007-03-26 at 09:21 +0200, Paolo Bonzini wrote:
> Well, it's there because a hash table needs more room than it has
> elements.
May I suggest instead smalltalk--backstage--2.2--patch-13:
* kernel/HashedColl.st: Treat new:'s argument as a requested
capacity.
This has the added benefit of meeting:
Refinement: <Dictionary factory>
The parameter count represents a hint for space allocation. The new
collection is to optimized to
contain count elements. The new collection initially contains no elements.
The reason I didn't notice this earlier was because for every size 1
bitShift: (size * 3 // 4) highBit => size. :)
HashedCollection>>withAll:'s definition might also want to change,
depending on what you think the probability of adding keys versus the
space savings of leaving off * 2 would be.
--
;;; Stephen Compall ** http://scompall.nocandysw.com/blog **
Failure to imagine vast possibilities usually stems from a lack of
imagination, not a lack of possibility.
gst-hashedcoll-new.diff
Description: Text Data
signature.asc
Description: This is a digitally signed message part
- Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail, (continued)
- Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail, Stephen Compall, 2007/03/22
- Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail, Jānis Rūcis, 2007/03/22
- Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail, Stephen Compall, 2007/03/22
- Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail, Paolo Bonzini, 2007/03/23
- Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail, Jānis Rūcis, 2007/03/23
- Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail, Paolo Bonzini, 2007/03/23
- Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail, Jānis Rūcis, 2007/03/23
- Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail, Paolo Bonzini, 2007/03/23
- Re: [Help-smalltalk] Dictionary>>#addAll: fails, Stephen Compall, 2007/03/23
- [Help-smalltalk] Re: Dictionary>>#addAll: fails, Paolo Bonzini, 2007/03/26
- [Help-smalltalk] Re: Dictionary>>#addAll: fails,
Stephen Compall <=
- Re: [Help-smalltalk] Re: Dictionary>>#addAll: fails, Paolo Bonzini, 2007/03/30
- [Help-smalltalk] Re: Dictionary>>#addAll: fails, Stephen Compall, 2007/03/29
- [Help-smalltalk] Re: Dictionary>>#addAll: fails, Jānis Rūcis, 2007/03/29
- [Help-smalltalk] Re: Dictionary>>#addAll: fails, Stephen Compall, 2007/03/29
- [Help-smalltalk] Re: Dictionary>>#addAll: fails, Jānis Rūcis, 2007/03/30
- [Help-smalltalk] Re: Dictionary>>#addAll: fails, Stephen Compall, 2007/03/30
- [Help-smalltalk] Re: Dictionary>>#addAll: fails, Jānis Rūcis, 2007/03/31
- Re: [Help-smalltalk] Re: Dictionary>>#addAll: fails, Paolo Bonzini, 2007/03/31
- [Help-smalltalk] Re: Dictionary>>#addAll: fails, Stephen Compall, 2007/03/31
- Re: [Help-smalltalk] Re: Dictionary>>#addAll: fails, Paolo Bonzini, 2007/03/30