Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] help
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jon Harrop <jdh30@c...>
Subject: Re: [Caml-list] help
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