caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: barnier@recherche.enac.fr
To: caml-list@inria.fr
Subject: Re: [Caml-list] Hashtbl performance
Date: Thu, 28 Jul 2011 14:25:29 +0200	[thread overview]
Message-ID: <20110728142529.ksntzfow5wo84404@www.recherche.enac.fr> (raw)
In-Reply-To: <4E313071.7090309@inria.fr>

Quoting 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.

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 :

# let list = ref [];;
   for i = 1 to 30 do
   list := i :: !list;
   Printf.printf "%d " (Hashtbl.hash_param 50 50 !list)
done  ;;
1 65601 8392706 797307010 578301955 731304131 182476804 222011652  
582000645 696017221 383840262 291574150 409554951 301052359 474071048  
875971080 459423753 1026998857 314757130 771437194 56324107 59478731  
841228300 921690892 921690892 841228300 59478731 56324107 771437194  
314757130 - : unit = ()

-- Nicolas Barnier


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


  reply	other threads:[~2011-07-28 12:25 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 [this message]
2011-07-28 14:18     ` Xavier Leroy
2011-07-28 16:29       ` Toby Kelsey

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=20110728142529.ksntzfow5wo84404@www.recherche.enac.fr \
    --to=barnier@recherche.enac.fr \
    --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).