Hi.
I measure latest VM with shallowCopy support. Copy now is much better:
object := 10@20.
3 timesRepeat: [ Smalltalk garbageCollect ].
result1 := [ Point x: 10 y: 20 ] benchFor: 10 seconds.
3 timesRepeat: [ Smalltalk garbageCollect ].
result2 := [ object shallowCopy ] benchFor: 10 seconds.
{result1. result2}.
"a BenchmarkResult(310,321,301 iterations in 10 seconds 2 milliseconds. 31,025,925 per second)
a BenchmarkResult(426,311,468 iterations in 10 seconds 3 milliseconds. 42,618,361 per second)"
But with "Point basicNew" it is almost same:
"a BenchmarkResult(402,708,088 iterations in 10 seconds 2 milliseconds. 40,262,756 per second)
a BenchmarkResult(405,145,766 iterations in 10 seconds 3 milliseconds. 40,502,426 per second)"
It also improves my veryDeepCopy test which works better on preSpur VM. (preSpur VM is still better):
m := Morph new.
r2 := [ m veryDeepCopy ] benchFor: 10 seconds.
"a BenchmarkResult(34,007 iterations in 10 seconds 3 milliseconds. 3,400 per second)" - no shallow copy optimization
"a BenchmarkResult(43,333 iterations in 10 seconds 1 millisecond. 4,333 per second)" - latest VM with shallow copy.
"a BenchmarkResult(52,985 iterations in 10 seconds 1 millisecond. 5,298 per second)" - preSpur VM