English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] Map efficiency?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-11-04 (07:59)
From: Dustin Sallings <dustin@s...>
Subject: [Caml-list] Map efficiency?

	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