libjpegtran performance issue and wokaround



Hello there,

Yesterday evening, when working on this
http://bugzilla.gnome.org/show_bug.cgi?id=165645 , I've experienced some
performance issues when using lossless jpeg rotation.
For this, I use JpegUtils.Transform which itself use libjpegtran.

Here is some benchmarks of exiftran (same code as jpegtran) for rotating
a 7Mpixels Jpeg image (file size: 3.18MB)

$ time exiftran -9 IMG_0952.JPG -o out.jpg

real    0m37.947s
user    0m1.473s
sys     0m26.873s

That time correspond to the time f-spot need to rotate lossless.

After googling around a bit this morning, I've found that you can speed
up jpegtran with allowing it to use more memory.

$ export JPEGMEM=64m
$ time exiftran -9 IMG_0952.JPG -o out.jpg
real    0m1.935s
user    0m1.564s
sys     0m0.242s

For this image and on my system with only 1G of ram, I encounter better
performances with JPEGMEM=64m than 128m, probably due to the time needed
to allocate memory or sg like this.

Now, I run f-spot like this:
$ export JPEGMEM=64m
$ f-spot

And the lossless rotations in f-spot are automagically speeded by a
factor of 10, at least.

My question to the list:
 - Back in 98, when jpegtran was released, the default amount of memory
was probably engouh. Now, with megapixels camera, we should probably
compile libjpegtran with a superior default. What do you think of this,
what's a good default value ?
 - With the great gap between entry level camera producing <200k files
and the high-end Digital SLR, storing probably >10M files, and also to
match with the user hardware configuration, could we foresee an runtime
option in the preference dialog ?

I'm waiting for your feedback. In the meantime, I'll try to see how to
enhance the default memory value in libjpegtran

Best regards,

Stefan




-- 
Stephane Delcroix
stephane delcroix org




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]