From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 004EBBC84 for ; Wed, 30 Mar 2005 14:03:05 +0200 (CEST) Received: from ptb-relay01.plus.net (ptb-relay01.plus.net [212.159.14.212]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j2UC34Z1017279 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 30 Mar 2005 14:03:05 +0200 Received: from [80.229.56.224] (helo=chetara) by ptb-relay01.plus.net with esmtp (Exim) id 1DGbuZ-000KmQ-Ov for caml-list@yquem.inria.fr; Wed, 30 Mar 2005 12:03:03 +0000 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Impact of GC on memoized algorithm Date: Wed, 30 Mar 2005 13:03:46 +0100 User-Agent: KMail/1.7.1 References: <424A65C4.2080507@barettadeit.com> In-Reply-To: <424A65C4.2080507@barettadeit.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200503301303.46742.jon@ffconsultancy.com> X-Miltered: at nez-perce with ID 424A9578.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 memoized:01 baretta:01 garbage:01 incorrectly:01 hash:01 clashes:01 hash:01 iirc:01 hashtbl:01 rec:01 ocaml:01 ...:98 frog:98 wrote:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: On Wednesday 30 March 2005 09:39, Alex Baretta wrote: > I have come to think that the difference in performance might be > attributable to the garbage collector. Try to objectively quantify the performance bottleneck using profiling, rather than speculating. Most of the time, most of the people speculate incorrectly. :-) In this case, if you are using an inappropriate data structure as the key to the hash table then you may be getting a lot of clashes. In which case, lots of time will be spent looking up elements in hash table's own list implementation. IIRC, most of the time will then be spent in the Hashtbl.find_rec function... -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists