[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: MATLAB
> Copy-on-mutate? What's that?
Copy-on-mutate is a form of lazy evaluation. It means that:
A = B
doesn't actually copy the values from B into A (A and B are values, not
pointers), instead it just remembers that A is supposed to be equal to
B. This saves memory and time. If we later mutate A or B, the copy
occurs. If you're extra slick, you can put off the copy until a
significant mutation occurs (just accumulate the mutations to apply
later) or until someone actually needs the value.
When big data structures are involved, this is a very handy
optimization, expecially if parts of data structures get lazily copied.
It also means you never use pointers for efficiency, only for
semantics.
-m
=====
Morgan McGuire
morgan3d@yahoo.com
__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com
- Follow-Ups:
- Re: MATLAB
- From: Michael Vanier <mvanier@bbb.caltech.edu>
- References:
- Re: MATLAB
- From: Michael Vanier <mvanier@bbb.caltech.edu>