caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] mutable Vs non mutable
@ 2002-06-11  8:50 Animesh Pathak
  2002-06-11  9:00 ` Basile STARYNKEVITCH
  0 siblings, 1 reply; 2+ messages in thread
From: Animesh Pathak @ 2002-06-11  8:50 UTC (permalink / raw)
  To: caml-list; +Cc: ocaml_beginnners

dear people,
I have a small question...

What are the costs incurred (if any) in terms of program size/speed if we use 
mutable variables in place of a non- mutable one??

Thanks for considering my Query

Animesh

-------------------
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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Caml-list] mutable Vs non mutable
  2002-06-11  8:50 [Caml-list] mutable Vs non mutable Animesh Pathak
@ 2002-06-11  9:00 ` Basile STARYNKEVITCH
  0 siblings, 0 replies; 2+ messages in thread
From: Basile STARYNKEVITCH @ 2002-06-11  9:00 UTC (permalink / raw)
  To: Animesh Pathak; +Cc: caml-list

>>>>> "Animesh" == Animesh Pathak <animesh.pathak@inria.fr> writes:

    Animesh> What are the costs incurred (if any) in terms of program
    Animesh> size/speed if we use mutable variables in place of a non-
    Animesh> mutable one??

Only fields are mutable. When a mutable field is overwritten, the
garbage collector's write barrier is exercised.

This has some costs, first inside the write barrier's code, and
eventually inside the GC itself.

I've got no idea about the quantitative costs. But I am not worried of
using mutable fields (eg references) in my code when needed.  (I first
try to find the right algorithms. Optimization is usually useless....)

Regards

N.B. Any opinions expressed here are only mine, and not of my organization.
N.B. Les opinions exprimees ici me sont personnelles et n engagent pas le CEA.

---------------------------------------------------------------------
Basile STARYNKEVITCH   ----  Commissariat à l Energie Atomique * France
DRT/LIST/DTSI/SLA * CEA/Saclay b.528 (p111f) * 91191 GIF/YVETTE CEDEX 
phone:+33 1,6908.6055; fax: 1,6908.8395 home: 1,4665.4553; mobile: 6,8501.2359
work email: Basile point Starynkevitch at cea point fr 
home email: Basile at Starynkevitch point net

-------------------
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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-06-11  9:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-11  8:50 [Caml-list] mutable Vs non mutable Animesh Pathak
2002-06-11  9:00 ` Basile STARYNKEVITCH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).