Poor performance of Java

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

Poor performance of Java

Gabriel Landini
Hi,
I noted that when dealing with several windows the performance of Java 1.8 is
appalling compared to 1.6, so I tested a few versions of Java under linux with
the following macro (just times the MRI Stack being converted to images).

run("MRI Stack (528K)");
t=getTime();
run("Stack to Images");
print (getTime()-t);
run("Images to Stack", "name=Stack title=[] use");

The difference is quite incredible, more than one order of magnitude (the
figures are the 'best' out of 3 runs):

// JavaVersion    Time(ms)   Batchmode(ms)
// 1.8 Oracle      7367         27
// 1.8 OpenJDK     7237         23
// 1.7 OpenJDK     7562         40
// 1.6 Oracle       554         32

Fortunately when the macro batch can be used, it avoids these delays, but when
running IJ interactively the poor performance is noticeable too.

I wonder why this performance glitch is there. Does this happen in Win and
Macs too?

Cheers

Gabriel

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Poor performance of Java

Mark Hiner
Hi Gabriel,

It seems like windows management (image windows - not the OS) has become
slower since Java 6. Understanding why exactly would likely require diving
into the Java source itself. It definitely is present in Mac.

The only workarounds I know of are to use Java 6 or, like you said, use
batch mode whenever possible.

Best,
Mark

On Fri, Dec 11, 2015 at 6:46 AM, Gabriel Landini <[hidden email]>
wrote:

> Hi,
> I noted that when dealing with several windows the performance of Java 1.8
> is
> appalling compared to 1.6, so I tested a few versions of Java under linux
> with
> the following macro (just times the MRI Stack being converted to images).
>
> run("MRI Stack (528K)");
> t=getTime();
> run("Stack to Images");
> print (getTime()-t);
> run("Images to Stack", "name=Stack title=[] use");
>
> The difference is quite incredible, more than one order of magnitude (the
> figures are the 'best' out of 3 runs):
>
> // JavaVersion    Time(ms)   Batchmode(ms)
> // 1.8 Oracle      7367         27
> // 1.8 OpenJDK     7237         23
> // 1.7 OpenJDK     7562         40
> // 1.6 Oracle       554         32
>
> Fortunately when the macro batch can be used, it avoids these delays, but
> when
> running IJ interactively the poor performance is noticeable too.
>
> I wonder why this performance glitch is there. Does this happen in Win and
> Macs too?
>
> Cheers
>
> Gabriel
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Poor performance of Java

Rasband, Wayne (NIH/NIMH) [E]
In reply to this post by Gabriel Landini
> On Dec 11, 2015, at 7:46 AM, Gabriel Landini <[hidden email]> wrote:
>
> Hi,
> I noted that when dealing with several windows the performance of Java 1.8 is
> appalling compared to 1.6, so I tested a few versions of Java under linux with
> the following macro (just times the MRI Stack being converted to images).

Hi Gabriel,

On my Mac laptop, your test macro takes twice as long to run on Java 1.8 compared to Java 1.6. On Windows, it runs the same speed with both Java 1.6 and Java 1.8, and it runs two times faster than my Mac running Java 1.6.

-wayne

> run("MRI Stack (528K)");
> t=getTime();
> run("Stack to Images");
> print (getTime()-t);
> run("Images to Stack", "name=Stack title=[] use");
>
> The difference is quite incredible, more than one order of magnitude (the
> figures are the 'best' out of 3 runs):
>
> // JavaVersion    Time(ms)   Batchmode(ms)
> // 1.8 Oracle      7367         27
> // 1.8 OpenJDK     7237         23
> // 1.7 OpenJDK     7562         40
> // 1.6 Oracle       554         32
>
> Fortunately when the macro batch can be used, it avoids these delays, but when
> running IJ interactively the poor performance is noticeable too.
>
> I wonder why this performance glitch is there. Does this happen in Win and
> Macs too?
>
> Cheers
>
> Gabriel

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Poor performance of Java

Thomas Boudier-4
In reply to this post by Gabriel Landini
Hi Gabriel,

For information on my computer with Debian stable, KDE 1.4, oracle java
1.8.0_66 :

665 ms and 6 ms, same results with Java 1.6.

Is these results linked to the WindowManager ?

Best,

Thomas



On 11/12/2015 20:46, Gabriel Landini wrote:

> Hi,
> I noted that when dealing with several windows the performance of Java 1.8 is
> appalling compared to 1.6, so I tested a few versions of Java under linux with
> the following macro (just times the MRI Stack being converted to images).
>
> run("MRI Stack (528K)");
> t=getTime();
> run("Stack to Images");
> print (getTime()-t);
> run("Images to Stack", "name=Stack title=[] use");
>
> The difference is quite incredible, more than one order of magnitude (the
> figures are the 'best' out of 3 runs):
>
> // JavaVersion    Time(ms)   Batchmode(ms)
> // 1.8 Oracle      7367         27
> // 1.8 OpenJDK     7237         23
> // 1.7 OpenJDK     7562         40
> // 1.6 Oracle       554         32
>
> Fortunately when the macro batch can be used, it avoids these delays, but when
> running IJ interactively the poor performance is noticeable too.
>
> I wonder why this performance glitch is there. Does this happen in Win and
> Macs too?
>
> Cheers
>
> Gabriel
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
  /***************************************************************/
       Thomas Boudier, Associate Professor, UPMC,
       Université Pierre et Marie Curie, Paris, France.
       BioInformatics Institute (BII)/IPAL, Singapore.
/**************************************************************/

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Poor performance of Java

Gabriel Landini
On Monday 14 Dec 2015 10:27:49 you wrote:
> Hi Gabriel,
>
> For information on my computer with Debian stable, KDE 1.4, oracle java
> 1.8.0_66 :
>
> 665 ms and 6 ms, same results with Java 1.6.
>
> Is these results linked to the WindowManager ?

Hi Thomas, thanks for your report. I do not know. I am using opensuse 13.2,
(KDE4.14.19 (tried opensuse Leap 42.1 and the abysmal performance is still
there (it uses the plasma 5 desktop), I tried ICEwm and it was even worse.
I doubt it is the WM, because Java 1.6 is more than 10 times quick in the same
session. I am very puzzled with this.

Cheers

Gabriel

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