From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA29654; Sat, 26 Jun 2004 09:40:01 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA29698 for ; Sat, 26 Jun 2004 09:40:00 +0200 (MET DST) Received: from nef.ens.fr (nef.ens.fr [129.199.96.32]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i5Q7dxSH027743 for ; Sat, 26 Jun 2004 09:39:59 +0200 Received: from clipper.ens.fr (clipper-gw.ens.fr [129.199.1.22]) by nef.ens.fr (8.12.11/1.01.28121999) with ESMTP id i5Q7dwdJ072664 ; Sat, 26 Jun 2004 09:39:58 +0200 (CEST) Received: from localhost (frisch@localhost) by clipper.ens.fr (8.12.3/jb-1.1) id i5Q7dujG024288 ; Sat, 26 Jun 2004 09:39:57 +0200 (MET DST) X-Authentication-Warning: clipper.ens.fr: frisch owned process doing -bs Date: Sat, 26 Jun 2004 09:39:56 +0200 (MET DST) From: Alain Frisch X-X-Sender: frisch@clipper.ens.fr Reply-To: Alain Frisch To: skaller cc: caml-list Subject: Re: [Caml-list] some profile data In-Reply-To: <1088185404.1941.126.camel@pelican.wigram> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-milter (http://amavis.org/) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.3.3 (nef.ens.fr [129.199.96.32]); Sat, 26 Jun 2004 09:39:59 +0200 (CEST) X-Miltered: at concorde with ID 40DD284F.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; alain:01 frisch:01 alain:01 frisch:01 caml-list:01 hash:01 descent:01 cyclic:01 profile:98 profile:98 polymorphic:01 wrote:03 recursive:03 types:03 data:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On 26 Jun 2004, skaller wrote: > This is curious enough to report: I use hash tables quite > a bit, but i didn't quite expect this profile: 2/3 of ALL time > doing comparisons?? You should be aware that the polymorphic compare function is slow (for each block, it has to do a dispatch on the tag, etc...). In general, it is a good idea to write your own compare function for your types; it also allows you to stop the recursive descent where you want (e.g. for comparing only some fields). And this is a must if you have cyclic data-structure. -- Alain ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners