Bug/Java issue? Speed in creating/closing images

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Bug/Java issue? Speed in creating/closing images

Gabriel Landini
Under linux, I noted a significant difference in the speed of a plugin
depending on the version of Java I use, so I tried to investigate a bit what
is going on.

One issue I found is a delay in creating and possibly closing images (?).
Oracle Java 1.6 is about 3 times faster than OpenJDK 1.7 or Oracle Java 1.8

t=getTime();
for (i=1;i<1000;i++){
newImage("1", "8-bit black", 767, 577, 1);
close();
}
print (getTime()-t);

However in batch mode they are all similar.

This other macro behaves very odd too. When run the first time, in Java 1.7
and 1.8 it gets momentarily stuck and takes about 4500ms to finish, subsequent
runs seem to run at about 150-200ms:

run("New...", "name=test type=8-bit fill=Black width=512 height=512
slices=1");
a=getImageID();
run("Duplicate...", "title=test-copy");
b=getImageID();

t=getTime();

selectImage(a);
selectImage(b);

selectImage(a);
selectImage(b);

selectImage(a);
selectImage(b);

selectImage(a);
selectImage(b);

selectImage(a);
selectImage(b);

print(getTime()-t+" ms.");
//---------------------------------

Do other people see a similar behaviour?

Cheers

Gabriel

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html