Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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 Archives:
Bug reports: FAQ:
Beginner's list: