From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id IAA01124; Tue, 4 Nov 2003 08:59:31 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id IAA00710 for ; Tue, 4 Nov 2003 08:59:29 +0100 (MET) Received: from bob.west.spy.net (mail.west.spy.net [66.149.231.226]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id hA47xR124604 for ; Tue, 4 Nov 2003 08:59:28 +0100 (MET) Received: from [192.168.1.196] (dhcp-196.west.spy.net [192.168.1.196]) by bob.west.spy.net (Postfix) with ESMTP id D4E8E58DC for ; Mon, 3 Nov 2003 23:59:24 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v606) Content-Transfer-Encoding: 7bit Message-Id: Content-Type: text/plain; charset=US-ASCII; format=flowed To: caml-list@inria.fr From: Dustin Sallings Subject: [Caml-list] Map efficiency? Date: Mon, 3 Nov 2003 23:59:24 -0800 X-Mailer: Apple Mail (2.606) X-Loop: caml-list@inria.fr X-Spam: no; 0.00; hashtbl:01 hashtbl:01 beginners:01 generic:01 map's:01 mutable:01 terribly:01 module:03 interface:03 interface:03 app:04 efficiency:05 efficient:05 type:07 i'm:07 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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