Fun project - faster associative array algorithm

Marco Leise via Digitalmars-d digitalmars-d at puremagic.com
Wed Apr 8 10:21:28 PDT 2015


Am Tue, 07 Apr 2015 19:09:15 +0000
schrieb "Jens Bauer" <doctor at who.no>:

> On Tuesday, 7 April 2015 at 17:25:00 UTC, Walter Bright wrote:
> > The current D associative array algorithm
> 
> I did a quick-scan of the source and didn't see any Bloom filter 
> there.
> I wonder if it would be best to have the Bloom filters completely 
> external or if they should be included in the associative array ?
> -Eg. the Bloom filter does require extra memory, which is not 
> always desirable.
> On the other hand, a Bloom filter could be opted in, where high 
> speed is required.

More precisely it adds a memory and time overhead, but
reduces the cost for most lookups of non-existent keys.

When you just want an associative array for known-to-exist
keys it would be a bad idea to use a Bloom filter. Opt in is
not possible with the current AA syntax as far as I can see.
Except you mean some wrapper struct as part of Phobos/druntime.

-- 
Marco



More information about the Digitalmars-d mailing list