[Mono-dev] faster than hashtable?
oskar.berggren at gmail.com
Wed Oct 28 05:28:47 EDT 2009
If you know your input set and can design a hash function that is
guaranteed to never give collisions for that input set, you could
perhaps gain something by implementing a hash table that ignores the
risk of collisions.
2009/10/28 Alan McGovern <alan.mcgovern at gmail.com>:
> If the key is random, a hashtable is the fastest way. You may be able to eke
> some extra speed out of the Dictionary<K, V> class by ripping all the code
> to support generic keys and instead hardcode the key to always be a long.
> That should save a bit of time, though whether it'd be noticable or not I
> don't know.
> On Wed, Oct 28, 2009 at 8:25 AM, Tom Spink <tspink at gmail.com> wrote:
>> 2009/10/27 psantosl at codicesoftware.com <psantosl at codicesoftware.com>:
>> > Hi,
>> > If you need to store key/value pairs, where the key will be ALWAYS a
>> > unique long (no collisions), is there anything better than a Hashtable?
>> > Thanks
>> > pablo
>> Presumably, though, the key can span the entire range of a long? If
>> it's an acceptably small range, you could use an array.
>> Tom Spink
>> Mono-devel-list mailing list
>> Mono-devel-list at lists.ximian.com
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
More information about the Mono-devel-list