From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p8JK9suh017131 for ; Mon, 19 Sep 2011 22:09:55 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4GAE2gd06t/9dF/2dsb2JhbABCmRqPG4IUezQBBJ4pn0oOhmoEh2+YX4RI X-IronPort-AV: E=Sophos;i="4.68,407,1312149600"; d="scan'208";a="109635249" Received: from li225-69.members.linode.com (HELO ahiker.homeip.net) ([173.255.215.69]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/AES256-SHA; 19 Sep 2011 22:09:48 +0200 Received: from adsl-75-30-78-219.dsl.pltn13.sbcglobal.net ([75.30.78.219] helo=matica) by ahiker.homeip.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1R5k9x-0008NQ-Rg for caml-list@inria.fr; Mon, 19 Sep 2011 13:09:45 -0700 From: Ian Zimmerman To: caml-list@inria.fr Date: Mon, 19 Sep 2011 13:09:39 -0700 Message-ID: <87sjnsl2f0.fsf@foolinux.dyndns.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [Caml-list] Hashtbl or Set? I need a somewhat large (thousands) set of strings, created once during startup and never modified after. What is a better choice, a (string, unit) Hashtbl.t or the Set module? If the Set module still uses trees as it did when I was young :-), access will be logarithmic versus constant for Hashtbl. But on the other hand a hash function must examine all of every string while the comparison of 2 strings stops at the first nonmatching character. I am thinking about the time to build the set as well as the probing time. -- Ian Zimmerman gpg public key: 1024D/C6FF61AD fingerprint: 66DC D68F 5C1B 4D71 2EE5 BD03 8A00 786C C6FF 61AD Rule 420: All persons more than eight miles high to leave the court.