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 VAA14255; Mon, 26 Apr 2004 21:17:48 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id VAA14031 for ; Mon, 26 Apr 2004 21:17:47 +0200 (MET DST) Received: from ptb-relay01.plus.net (ptb-relay01.plus.net [212.159.14.212]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i3QJHljq019377 for ; Mon, 26 Apr 2004 21:17:47 +0200 Received: from [80.229.56.224] (helo=chetara) by ptb-relay01.plus.net with esmtp (Exim) id 1BIBbu-000Euw-Ia for caml-list@inria.fr; Mon, 26 Apr 2004 19:17:46 +0000 From: Jon Harrop Organization: University of Cambridge To: caml-list@inria.fr Subject: Re: [Caml-list] help Date: Mon, 26 Apr 2004 20:13:42 +0100 User-Agent: KMail/1.5.4 References: In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200404261842.59208.jdh30@cam.ac.uk> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 2004:99 ocamlopt:01 indirection:01 timings:01 mutable:01 mutable:01 assembler:01 assembler:01 fewer:02 henri:03 identical:03 wrote:03 slightly:03 seems:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sunday 25 April 2004 1:45 pm, Henri DF wrote: > > I deliberately made "wnum" a reference so that it can be set: > > any reason not to make it a mutable ? No good reason. ;) I've just been looking at the assembler output from ocamlopt on this. I think that a mutable record field represents one fewer levels of indirection compared to a reference record field. On a contrived example, using mutable is twice as fast. Comparing a mutable record field to a reference (not in a record), the latter comes out as slightly quicker in my timings. But I think this is insignificant as the assembler output seems to be identical. Cheers, Jon. ------------------- 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