You mean 'twice as fast'? I must say I find it hard to believe this
would ever be faster. In both cases one has to read the source object,
allocate storage for a new object, and copy. The serialization method
does strictly more work, by allocating a byte array,
serializing/deserializing, and copying in between. I agree, copies
should be avoided if possible anyway. but it's my strong guess that we
don't want to implement any clone() methods this way -- it's pretty
simple to write clone() anyhow. As always, open to being proven wrong
by data...

On Sun, Jun 21, 2009 at 1:18 PM, Ted Dunning<[email protected]> wrote:
> For small vectors, I would believe that.  For large vectors, I would not be
> surprised to see the round-trip to be up to half as fast.
>
> The fact is, however, that you want to avoid copying for large vectors and
> matrices.

Reply via email to