AA dsource project

dsimcha dsimcha at yahoo.com
Wed Nov 4 20:38:41 PST 2009


== Quote from Walter Bright (newshound1 at digitalmars.com)'s article
> dsimcha wrote:
> > I couldn't find your benchmarks, but here are my results:
> >
> > Builtin:
> > Start Benchmark.
> > 1 x 10000000 iterations
> > inserts:  394601/s (25.342000s)
> > lookups: 9813542/s (1.019000s)
> >
> > PyDict:
> > Start Benchmark.
> > 1 x 10000000 iterations
> > inserts:  2044153/s (4.892000s)
> > lookups: 3401360/s (2.940000s)
> >
> > This pretty much confirms my suspicion that the builtin AAs are optimized for
> > lookup speed at the expense of insertion speed/GC overhead to an absurd degree.
> Perhaps some combination would work. I'd be reluctant to go with a 3x
> slower lookup speed.

I've also just added my RandAA candidate, which uses parallel arrays and linear
congruential randomized probing.  It gives insertion speed comparable to the
PyDict, with lookup speed only about 30-40% slower instead of 150-200%.  For more
benchmark details, see the wiki http://dsource.org/projects/aa/wiki/WikiStart,
which I've just updated.


More information about the Digitalmars-d-announce mailing list