From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id E232EBC69 for ; Tue, 24 Oct 2006 22:13:33 +0200 (CEST) Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id k9OKDVBj024116 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Tue, 24 Oct 2006 22:13:33 +0200 Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1GcSe9-0000pC-SE for caml-list@inria.fr; Tue, 24 Oct 2006 22:13:14 +0200 Received: from fw by deneb.enyo.de with local (Exim 4.63) (envelope-from ) id 1GcSd6-0006UB-16 for caml-list@inria.fr; Tue, 24 Oct 2006 22:12:08 +0200 From: Florian Weimer To: caml-list@inria.fr Subject: Re: [Caml-list] mutable record fields and performance References: <20061021034125.GA15596@malaquias.gwiceb1> Date: Tue, 24 Oct 2006 22:12:07 +0200 In-Reply-To: <20061021034125.GA15596@malaquias.gwiceb1> (j. romildo's message of "Sat, 21 Oct 2006 00:41:25 -0300") Message-ID: <87psch8odk.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Miltered: at discorde with ID 453E73EB.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; mutable:01 romildo:01 mutable:01 compiler:01 caml-list:01 exception:01 expression:01 int:01 int:01 declaration:02 florian:03 types:03 optimization:03 perhaps:04 performs:06 * j. romildo: > That is, the expression p.x has different performances for the types > { x:int } and { mutable x:int } for p? > > In summary, what additional cost does the use of mutable imposes on a > record field? Internally, record fields are always mutable. Adding a mutable declaration should not incur a performance cost. perhaps with the exception that the compiler will see less opportunities for elimination of common subexpression (but I'm not sure if it performs this optimization at all).