Re: System.arrayCopy Vs array clone



Hello Arne,

Arne Vajhøj a écrit :
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.

True. I'm using Java 1.5 and win32 x86.
J. Bloch were using Java 1.3 and win32 x86.
However he didn't say explicitly that he ran such benchmark by himself for this matter. His expression was: "Because of its many shortcomings, some expert programmers simply choose never to override the clone method and never to invoke it except, perhaps, to copy arrays cheaply".

That said then my expectation will be that:
- the difference is small because they basically do the same thing

Hmmm... Clone() entails the navigation through the inheritance hierarchy to finally invoke Object.clone(), then by a mechanism I ignore the details provide an instance of the correct type.

- extremely few real world applications will be effected by the
difference

Arne
.



Relevant Pages

  • Re: JAVA as C (or C++) Front End
    ... Whenever I write and compile a ... > java program, I have to invoke it by calling Java.EXE. ... > software which is obviously written in Java which is invoked with an EXE ... One 'pro' for having the the C code invoke the java code is that you will then ...
    (comp.lang.java.programmer)
  • Re: java - invoke
    ... You have stumbled on one of the most subtle features of Java called ... You create call lists of parameters on the fly and invoke methods. ... It is a tool to allow java code to use arbitrary class files handed to ... You can usually get what you want without resorting to reflection ...
    (comp.lang.java.help)
  • Re: Problem Passing args to Java from Matlab
    ... just use a matlab string ... I'm using a java api from Matlab, and I can not get the call data ... Then I try to call invoke. ... str = java.lang.String ...
    (comp.soft-sys.matlab)
  • Need advise on using java for RPC
    ... I'm new to java and web services. ... string command to be used as input argument for my compute.exe ... the form of XML and send via http to the server. ... I set up a webservice using J2EE, how do I invoke my compute.exe? ...
    (comp.lang.java.programmer)
  • Re: finalize() not guaranteed to be called -- ever
    ... Then the Java object should have some kind of dispose method. ... It is very different in that it is possible to write C++ programs in which the destructors are never invoked manually but do run. ... C++ you can put objects on the heap as well and when you do the destructor is called manually using the delete statement. ... Either the object itself is stack based or you use a stack based object to invoke the ...
    (comp.lang.java.programmer)