ImageJ Plug-in - Extreme (10x) Execution Time Variability.

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

ImageJ Plug-in - Extreme (10x) Execution Time Variability.

Richard VanMetter
I have found a simple work-around/fix for the execution time problem
(for details see my previous posting under this topic).

The problem appears to be caused by the size (lines of code) of one of
the methods in my plug-in. I simply removed one of the sections of code,
put it in a separate method which is called by the original (too large)
method. Now the plug-in executes at full speed ~600 ms as opposed to 7
seconds.

I don't know what the maximum size for a method is in Java before these
unhappy slowdown effects occur, or how to increase this size. In my case
the original method was just over 400 lines of code. The new method is
about 50 lines shorter.

Note: Some experimentation with the -XX:MaxInlineSize= switch on the
java runtime environment when invoking ImageJ was not successful.
Nonetheless, I would like to thank Stephan Saalfeld for his suggestion.

I remember reading somewhere that Java prefers many small methods to few
large ones. Guess I should have taken that to heart.

Thanks

Rich