
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 05/02/2010 06:43 PM, Peter Dimov wrote:
Times are measured in seconds, using two sets of ten 2048-bit integers. The tests consisted of adding each of those pairs of numbers together 10,000 times, multiplying them 10,000 times, and doing a "mulmod" operation on them (with a third randomly-generated 2048-bit modulus argument) 1,000 times. Each test was run three times, under as close to
Move semantics can optimize away some allocations that copy on write can't, such as for example
w = x * y + z;
(assuming that x*y already has enough bits to store x*y+z).
The copy-on-write code should optimize that allocation away too, under those circumstances.
But it doesn't have to be either-or; you can move even when copy on write is used.
I tested that in my original tests, but it didn't seem to be useful. The results were halfway between move-only and copy-on-write-only, so I eliminated it for this round. - -- Chad Nelson Oak Circle Software, Inc. * * * -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkveBP0ACgkQp9x9jeZ9/wTrGgCgi5rtDWC1TJczPq3/dtqMnmbz i8cAoNLkc6oqgPbEb5AtojghAr3WLi0Z =2m94 -----END PGP SIGNATURE-----