sorry, Dons,

---------- Forwarded message ----------
From: Alberto G. Corona <agocorona@gmail.com>
Date: 2008/11/18
Subject: Re: [Haskell-cafe] implementing python-style dictionary in Haskell
To: Don Stewart <dons@galois.com>


By the way byteStrings are wonderful, but, it  isnīt true that byteStrings are not so fast for managing short strings, for example keys ?

2008/11/18 Don Stewart <dons@galois.com>

dave:
> 2008/11/18 kenny lu <haskellmail@gmail.com>:
> > Here is a comparison of memory usage
> >
> > Map     : 345 MB
> > IntMap : 146 MB
> > Trie     : 282 MB
> > Python : 94 MB
> >
> > Here is a comparison of execution time (on an intel dual core 2.0G)
> >
> > Map: 26 sec
> > IntMap: 9 sec
> > Trie: 12 sec
> > Python: 2.24 sec
> >
> >
> > The above number shows that my implementations of python style dictionary
> > are space/time in-efficient as compared to python.
> >
> > Can some one point out what's wrong with my implementations?
>
> This isn't really a fair comparison. Map, IntMap, and Trie are
> persistent data structures, and Python dictionaries are ephemeral.
> (That is, when you "add" a key to a Map, you actually create a new one
> that shares structure with the old one, and both can be used in
> subsequent code. In Python, you would have to copy the dictionary.)
>

Strings, not ByteStrings. that's the difference.

-- Don
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe