caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe Filliatre <Jean-Christophe.Filliatre@lri.fr>
To: Alex Baretta <alex@barettadeit.com>
Cc: "Marcin 'Qrczak' Kowalczyk" <qrczak@knm.org.pl>, caml-list@inria.fr
Subject: Re: [Caml-list] Impact of GC on memoized algorithm
Date: Thu, 31 Mar 2005 16:41:38 +0200	[thread overview]
Message-ID: <16972.3106.484623.189533@gargle.gargle.HOWL> (raw)
In-Reply-To: <424ABFAE.7080309@barettadeit.com>


Marcin 'Qrczak' Kowalczyk wrote:
> 
> No, OCaml's hash tables are resized automatically.

Alex Baretta writes:
> 
> Ok. So, just as I expected, I am guaranteed that I have no hash 
> conflicts desperately degrading the performance of my algorithm. 

Note that it is true only if your hash function is good enough.

I had once a code spending most of its time in the resizing of Ocaml's
hash tables because of a  bad hash function. This is particularly true
of the ocaml  default hash function on ``pure''  abstract syntax trees
(recursive data types with few  types such as int or strings). Writing
my own hash function immediately solved the performance issue.

(In your case, however, the problem seems to be elsewhere ince you are
using unique integers as keys).

As somebody already  said, a profiling is a simple way  to find out if
the hash tables resizing is the issue.

Best regards,
-- 
Jean-Christophe


  reply	other threads:[~2005-03-31 14:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-30  8:39 Alex Baretta
2005-03-30 12:03 ` [Caml-list] " Jon Harrop
2005-03-30 12:34   ` Alex Baretta
2005-03-30 13:09     ` Alexander S. Usov
2005-03-30 13:56       ` Marcin 'Qrczak' Kowalczyk
2005-03-30 15:03         ` Alex Baretta
2005-03-31 14:41           ` Jean-Christophe Filliatre [this message]
2005-04-11 14:22           ` Damien Doligez
2005-04-11 15:48             ` Alex Baretta
2005-04-14  9:52               ` Damien Doligez
2005-04-14 10:27                 ` Jan Kybic

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=16972.3106.484623.189533@gargle.gargle.HOWL \
    --to=jean-christophe.filliatre@lri.fr \
    --cc=alex@barettadeit.com \
    --cc=caml-list@inria.fr \
    --cc=qrczak@knm.org.pl \
    /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).