<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/11/5bfc54158708ba55850a695ef7c3c554"
  from="Dustin Sallings &lt;dustin@s...&gt;"
  author="Dustin Sallings"
  date="2003-11-04T07:59:31"
  subject="[Caml-list] Map efficiency?"
  prev="2003/11/9caf042d7c5391a959764eb56c3450e0"
  next="2003/11/4f6f0f0d0e94235cac264fe76793b7fc"
  next-in-thread="2003/11/91764b53dcd86cc5f53036ba2f425604"
  prev-thread="2003/11/1d87c05e41bbe7ce253007f8039e67d7"
  next-thread="2003/11/26590f366f401c39cd62b82a784477dd"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Map efficiency?">
<msg 
  url="2003/11/5bfc54158708ba55850a695ef7c3c554"
  from="Dustin Sallings &lt;dustin@s...&gt;"
  author="Dustin Sallings"
  date="2003-11-04T07:59:31"
  subject="[Caml-list] Map efficiency?">
<msg 
  url="2003/11/91764b53dcd86cc5f53036ba2f425604"
  from="Jean-Christophe Filliatre &lt;Jean-Christophe.Filliatre@l...&gt;"
  author="Jean-Christophe Filliatre"
  date="2003-11-04T09:26:33"
  subject="Re: [Caml-list] Map efficiency?">
<msg 
  url="2003/11/105804fae41a4cd8c283a86811016fc2"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2003-11-04T10:00:31"
  subject="Re: [Caml-list] Map efficiency?">
</msg>
<msg 
  url="2003/11/95f6667080814ef5f524be3244d1dd48"
  from="Issac Trotts &lt;ijtrotts@u...&gt;"
  author="Issac Trotts"
  date="2003-11-04T19:49:13"
  subject="Re: [Caml-list] Map efficiency?">
</msg>
</msg>
<msg 
  url="2003/11/5ef9da757ad2ccf960d678f264ec9887"
  from="Christian Lindig &lt;lindig@c...&gt;"
  author="Christian Lindig"
  date="2003-11-04T09:41:17"
  subject="Re: [Caml-list] Map efficiency?">
<msg 
  url="2003/11/dec982bc53112706fdf5984d7d508524"
  from="Alex Baretta &lt;alex@b...&gt;"
  author="Alex Baretta"
  date="2003-11-04T18:14:46"
  subject="Re: [Caml-list] Map efficiency?">
<msg 
  url="2003/11/fcf4916c9d449dfdc24dc7760ef38db4"
  from="Nicolas Cannasse &lt;warplayer@f...&gt;"
  author="Nicolas Cannasse"
  date="2003-11-05T01:09:46"
  subject="Re: [Caml-list] Map efficiency?">
</msg>
<msg 
  url="2003/11/20edba130889464de589400be1d0760d"
  from="Jean-Christophe Filliatre &lt;Jean-Christophe.Filliatre@l...&gt;"
  author="Jean-Christophe Filliatre"
  date="2003-11-07T08:41:32"
  subject="Re: [Caml-list] Map efficiency?">
<msg 
  url="2003/11/e1bad687e478861296fd916bf372c385"
  from="Yaron M. Minsky &lt;yminsky@c...&gt;"
  author="Yaron M. Minsky"
  date="2003-11-07T11:39:44"
  subject="Why are functors better? (Re: [Caml-list] Map efficiency?)">
<msg 
  url="2003/11/7ec5b0a474c6574105aed93a0b8e4678"
  from="Michael Hicks &lt;mwh@c...&gt;"
  author="Michael Hicks"
  date="2003-11-07T14:02:11"
  subject="Re: Why are functors better? (Re: [Caml-list] Map efficiency?)">
</msg>
<msg 
  url="2003/11/e93bd0cf7e76cd82bbe9874192ba5515"
  from="Fernando Alegre &lt;fernando@c...&gt;"
  author="Fernando Alegre"
  date="2003-11-07T14:08:59"
  subject="Re: Why are functors better? (Re: [Caml-list] Map efficiency?)">
</msg>
</msg>
<msg 
  url="2003/11/0c6fb332cf336b39bf4442bf304e2f7b"
  from="Florian Hars &lt;hars@b...&gt;"
  author="Florian Hars"
  date="2003-11-07T14:49:51"
  subject="Re: [Caml-list] Map efficiency?">
</msg>
</msg>
</msg>
<msg 
  url="2003/11/26e98349ede248f8c61411089f48e045"
  from="Dustin Sallings &lt;dustin@s...&gt;"
  author="Dustin Sallings"
  date="2003-11-04T19:38:12"
  subject="Re: [Caml-list] Map efficiency?">
</msg>
</msg>
</msg>
</thread>

<contents>

	Should I expect Hashtbl to be more efficient than Map with the same 
key type?  I'm taking a small performance hit in a log processing app 
after turning a Hashtbl into a Map.

	This was a sample of 340,720 records.  There were that many finds and 
1,440 adds.  Since the Hashtbl is mutable, the add is in place and the 
usage is pretty straightforward.  In order to get Map to work the same 
way, I am using a reference to it everywhere.

	The times were actually very similar between the two, but I was kinda 
hoping Map would be faster.  :)

	Also, is there a particular reason Map is so, um, inaccessible to 
beginners?  Hashtbl's generic interface is much more inviting than 
Map's functorial-only interface, especially to those not terribly 
familiar with the module system.

-- 
Dustin Sallings

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

</contents>

</message>

