[JAI-IMAGEIO] About the JPEG reading performance
As my imaging application uses JPEG for encoding thumbnails, and
there are batches of thumbnails that need to be shown as quick as
possible, I need to optimize the things in this area.
I've read previous emails and links about this topic, and I
understand that at the moment the performance in this area is not
good. I need to have some confirmations:
1. JAI provides its own optimized JPEG reader, but it needs the
native libraries (which I don't have, as I'm on Mac OS X) - in this
case it falls back to the ImageI/O reader, right?
2. JAI provides also a JPEG2000 reader/writer, but its performance is
poor without the native libraries;
3. Should I use the TIFF writer/reader with JPEG compression, would
it use the same code of the JPEG codecs? Or would it be faster/
slower? The point is that I can control the format of the thumbnails,
and I could use a different format than JPEG if it was convenient:
any other format could be faster? I need to get a compression similar
to JPEG though.
Also, I've just changed my code to use all the cores on my laptop
(that is, processing two images in parallel) and I got a surprise:
the time to read a JPEG (400x400) using a single core is around
130msec (mean duration in 50 rounds), while the time to read two
JPEGs (same file) using two cores at the same time is 230msec. It's
getting worse instead of improving. Note that the test is done
reading the image from two distinct memory buffers, thus the disk I/O
access etc... can't be an issue. Maybe the native code for the JPEG
stuff is single thread?
Fabrizio Giudici, Ph.D. - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/blog
Fabrizio.Giudici@tidalwave.it - mobile: +39 348.150.6941