3) I am reading about support for more (unsigned) primitive data
types, use of generics etc. I consider myself a Java person, but this
is where Java is particularly bad at, not to talk about some notorious
performance issues. How important is Java in this context?
I think that we should anticipate also another possibility. Notably,
the use of ImageJ with specific hardware, for example writing code to
employ the parallel core of the GPUs. This can in itself require mass
rewriting of the code.
* Performance IS an issue and for image processing and some of us
would prefer to rather get 10x the current power of our current
computers than only 25%. To obtain this level of performance, some
central parts (eg., filters and other regular but time-consuming
tasks) must be recoded in one or the other way, possibly using GPU
functionality. In an earlier post I called these modules "performance
packs", which will be plattform-dependent (as as the JVM) but should
be installed transparently to the API user.
> It would be really cool if there were an option to use -if available-> OpenCL<http://en.wikipedia.org/wiki/OpenCL>for
> computations/transformations... (
> JOCL <http://www.jocl.org/>)
>
you can also use the OpenCL bindings I have written for Endrov.
http://sourceforge.net/projects/jopencl/
unlike JOCL, it's open source
Hi everyone,
One important factor to consider when scrutinizing the ImageJ codebase is performance. Historically, Java performance has lagged behind C++ and other natively compiled languages, although Java performance has greatly improved this decade and is now generally within a factor of two of C (see Java section of the LOCI FAQ: http://loci.wisc.edu/faq). In short, Java is easier and more cross-platform than lower-level languages such as C++, and more performant than higher-level scripting languages such as Python, making it a good balance for projects like ImageJ.
The standard approach for improving performance is to identify and target bottlenecks, rather than "prematurely optimize" code. One common technique for doing so, assuming the bottleneck algorithm cannot simply be optimized further, is to delegate that section of code to a more performant framework, such as a natively compiled version (e.g., platform-specific compiled "performance packs"). However, as several people already mentioned, it has recently proven effective and popular to use graphics cards to assist with code execution, as well as parallel processing to improve performance. The OpenCL standard is an effective new way to utilize both techniques in a cross-platform manner, making it a promising candidate for use with ImageJ.
--
You received this message because you are subscribed to the Google Groups "ImageJX" group.
To post to this group, send email to ima...@googlegroups.com.
To unsubscribe from this group, send email to imagejx+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/imagejx?hl=en.
On Thu, Dec 24, 2009 at 1:25 AM, Curtis Rueden <ctrued...@gmail.com> wrote:
Hi everyone,
One important factor to consider when scrutinizing the ImageJ codebase is performance. Historically, Java performance has lagged behind C++ and other natively compiled languages, although Java performance has greatly improved this decade and is now generally within a factor of two of C (see Java section of the LOCI FAQ: http://loci.wisc.edu/faq). In short, Java is easier and more cross-platform than lower-level languages such as C++, and more performant than higher-level scripting languages such as Python, making it a good balance for projects like ImageJ.
I concur. the only real unsolvable annoyance with java vs C++ is that java sometimes cannot optimize away array out of bounds-checks. these can kill performance (branch prediction reduces this problem a bit). I would like to have an @annotation to tell the compiler to simply not insert them and let me guarantee that they won't be needed. it kills some safety properties of java but so does JNI; these can at least be ignored by the compiler if wanted, and inserted once the code is tested and works. I have mentioned it to some openjdk people but it would help if someone else also gave them a push.
--
-----------------------------------------------------------
Johan Henriksson
PhD student, Karolinska Institutet
http://mahogny.areta.org http://www.endrov.net
I would assume that array bounds checking code is generated by the JIT
compiler. I made some experiments in the past with Sun's (and BEA's)
JVMs and noticed that Sun's server version was a lot smarter with this
than the (usual) client version. For example, given something like
int [] A ...
for (int i=0; i<A.length; i++) {
// do something with A[i] ...
}
access to A[i] is guaranteed to be within the boundaries of A, and the
server JVM seems to run the loop without boundary checking code. It is
easy to inhibit this mechanism though, for example, if you change the
above to
int [] A ...
int N = A.length;
for (int i=0; i<N; i++) {
// do something with A[i] ...
}
Nevertheless, the performance differences were striking in some
situations. I reported this to Wayne but did not follow up on the
subject. Would be interesting to try with the current JVMs.
--Wilhelm
On Dec 24, 1:46 pm, Gábor Bakos <aborga...@gmail.com> wrote:
> Hi Johan,
> 2009/12/24 Johan Henriksson <maho...@areta.org>
>
>
>
>
>
>
>
> > On Thu, Dec 24, 2009 at 1:25 AM, Curtis Rueden <ctrueden.w...@gmail.com>wrote:
>
> >> Hi everyone,
>
> >> One important factor to consider when scrutinizing the ImageJ codebase is
> >> performance. Historically, Java performance has lagged behind C++ and other
> >> natively compiled languages, although Java performance has greatly improved
> >> this decade and is now generally within a factor of two of C (see Java
> >> section of the LOCI FAQ:http://loci.wisc.edu/faq). In short, Java is
> >> easier and more cross-platform than lower-level languages such as C++, and
> >> more performant than higher-level scripting languages such as Python, making
> >> it a good balance for projects like ImageJ.
>
> > I concur. the only real unsolvable annoyance with java vs C++ is that java
> > sometimes cannot optimize away array out of bounds-checks. these can kill
> > performance (branch prediction reduces this problem a bit). I would like to
> > have an @annotation to tell the compiler to simply not insert them and let
> > me guarantee that they won't be needed. it kills some safety properties of
> > java but so does JNI; these can at least be ignored by the compiler if
> > wanted, and inserted once the code is tested and works. I have mentioned it
> > to some openjdk people but it would help if someone else also gave them a
> > push.
>
> Do you have a reference/test where the performance problem was really caused
> by the array checks within a recent JVM implementation? (Have you seen this
> blog entry<http://blogs.azulsystems.com/cliff/2009/09/java-vs-c-performance-agai...>
> ?)
> As I know the Sun JDK does not emit byte codes to check index bounds, the
> JVM executes the checks for the array access byte
> code<http://en.wikipedia.org/wiki/Java_bytecode_instruction_listings>s.
> Wernher von Braun <http://quotes4all.net/quote_993.html>- Hide quoted text -
>
> - Show quoted text -
--
You received this message because you are subscribed to the Google Groups "ImageJX" group.
To post to this group, send email to ima...@googlegroups.com.
To unsubscribe from this group, send email to imagejx+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/imagejx?hl=en.