Version française
Home     About     Download     Resources     Contact us    
Browse thread
mutable record fields and performance
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Florian Weimer <fw@d...>
Subject: Re: [Caml-list] mutable record fields and performance
* 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).