Re: System.arrayCopy Vs array clone
- From: Arne Vajhøj <arne@xxxxxxxxxx>
- Date: Tue, 27 Feb 2007 22:41:35 -0500
mei wrote:
I read in bloch's effective java that the only interesting use of clone() is to copy array cheaply. On the web, I found opposite opinions: Some people pretend that instantiate a new array, then call System.arrayCopy is faster.
I made a quick bench that seems to confirm this second hypothesis.
However, with all the respect I have for the author, I wished all the same to ask the question on this newsgroup. Is there something I and a few other people from the Internet missed?
It probably depend on Java vendor, platform and version.
Meaning that there are a few hundred possible results.
There are absolutely no guarantee that IBM Java 1.3.1 on AIX PPC
will have same characteristics as SUN Java 1.5.0 on Win32 x86.
That said then my expectation will be that:
- the difference is small because they basically do the same thing
- extremely few real world applications will be effected by the
difference
Arne
.
- Follow-Ups:
- Re: System.arrayCopy Vs array clone
- From: mei
- Re: System.arrayCopy Vs array clone
- References:
- System.arrayCopy Vs array clone
- From: mei
- System.arrayCopy Vs array clone
- Prev by Date: Re: Sockets - No Outgoing / Only Incoming
- Next by Date: Re: NewBee help with HashMaps - extra
- Previous by thread: Re: System.arrayCopy Vs array clone
- Next by thread: Re: System.arrayCopy Vs array clone
- Index(es):