caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Basile STARYNKEVITCH <basile.starynkevitch@cea.fr>
To: Animesh Pathak <animesh.pathak@inria.fr>
Cc: caml-list@inria.fr
Subject: [Caml-list] mutable Vs non mutable
Date: Tue, 11 Jun 2002 11:00:40 +0200	[thread overview]
Message-ID: <15621.48184.612059.440907@is002254.saclay.cea.fr> (raw)
In-Reply-To: <200206110850.g5B8o8L02883@payia.inria.fr>

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


      reply	other threads:[~2002-06-11  9:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-11  8:50 Animesh Pathak
2002-06-11  9:00 ` Basile STARYNKEVITCH [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15621.48184.612059.440907@is002254.saclay.cea.fr \
    --to=basile.starynkevitch@cea.fr \
    --cc=animesh.pathak@inria.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).