sorry, Dons,<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Alberto G. Corona</b> <span dir="ltr">&lt;<a href="mailto:agocorona@gmail.com">agocorona@gmail.com</a>&gt;</span><br>
Date: 2008/11/18<br>Subject: Re: [Haskell-cafe] implementing python-style dictionary in Haskell<br>To: Don Stewart &lt;<a href="mailto:dons@galois.com">dons@galois.com</a>&gt;<br><br><br>By the way byteStrings are wonderful, but, it &nbsp;isnīt true that byteStrings are not so fast for managing short strings, for example keys ?<br>
<br><div class="gmail_quote">2008/11/18 Don Stewart <span dir="ltr">&lt;<a href="mailto:dons@galois.com" target="_blank">dons@galois.com</a>&gt;</span><div><div></div><div class="Wj3C7c"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">dave:<br>
<div>&gt; 2008/11/18 kenny lu &lt;<a href="mailto:haskellmail@gmail.com" target="_blank">haskellmail@gmail.com</a>&gt;:<br>
&gt; &gt; Here is a comparison of memory usage<br>
&gt; &gt;<br>
&gt; &gt; Map &nbsp; &nbsp; : 345 MB<br>
&gt; &gt; IntMap : 146 MB<br>
&gt; &gt; Trie &nbsp; &nbsp; : 282 MB<br>
&gt; &gt; Python : 94 MB<br>
&gt; &gt;<br>
&gt; &gt; Here is a comparison of execution time (on an intel dual core 2.0G)<br>
&gt; &gt;<br>
&gt; &gt; Map: 26 sec<br>
&gt; &gt; IntMap: 9 sec<br>
&gt; &gt; Trie: 12 sec<br>
&gt; &gt; Python: 2.24 sec<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; The above number shows that my implementations of python style dictionary<br>
&gt; &gt; are space/time in-efficient as compared to python.<br>
&gt; &gt;<br>
&gt; &gt; Can some one point out what&#39;s wrong with my implementations?<br>
&gt;<br>
&gt; This isn&#39;t really a fair comparison. Map, IntMap, and Trie are<br>
&gt; persistent data structures, and Python dictionaries are ephemeral.<br>
&gt; (That is, when you &quot;add&quot; a key to a Map, you actually create a new one<br>
&gt; that shares structure with the old one, and both can be used in<br>
&gt; subsequent code. In Python, you would have to copy the dictionary.)<br>
&gt;<br>
<br>
</div>Strings, not ByteStrings. that&#39;s the difference.<br>
<font color="#888888"><br>
-- Don<br>
</font><div><div></div><div>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div></div></div><br>
</div><br>