caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Toby Kelsey <toby.kelsey@gmail.com>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Hashtbl performance
Date: Thu, 28 Jul 2011 17:29:49 +0100	[thread overview]
Message-ID: <4E318E7D.6060802@gmail.com> (raw)
In-Reply-To: <4E316FA2.7040108@inria.fr>

On 28/07/11 15:18, Xavier Leroy wrote:
> Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>:
> 
>> Thus, you should consider using your own hash function, probably only
>> considering the ints in the list and its length. Then, use the functor
>> in the Hashtbl module.
> 
> On 07/28/2011 02:25 PM, barnier@recherche.enac.fr wrote:
> 
>> You could also use the hash_param : int -> int -> 'a -> int
>> function in the functor which allows to specify the number
>> of nodes traversed to compute the key :
> 
> Both Fabrice's and Nicolas's suggestions are excellent.
> 
> Let me just add that this problem with lists as hashtable keys is one
> of the known issues with OCaml's current generic hash function: the
> other is that the mixing functions used are simplistic and exhibit
> some statistical bias, even for strings.

I will try both suggestions and look at the SVN trunk. Let me just add that the lists being hashed are all of length 5, so the length should not be the issue.
Hopefully 3.13 will fix this problem.

Thanks everyone for the useful suggestions,
Toby


      reply	other threads:[~2011-07-28 16:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-27 21:07 Toby Kelsey
2011-07-28  9:48 ` Fabrice Le Fessant
2011-07-28 12:25   ` barnier
2011-07-28 14:18     ` Xavier Leroy
2011-07-28 16:29       ` Toby Kelsey [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E318E7D.6060802@gmail.com \
    --to=toby.kelsey@gmail.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).