JDK-8125256 : JPEG loading is really slow for thumbnails
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: 8
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2012-08-30
  • Updated: 2015-06-17
  • Resolved: 2012-08-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8Fixed
Related Reports
Relates :  
Description
When loading images with new Image(<URL>, <thumb_width>, <thumb_height>, true, true) when the source image is much bigger than the thumbnail size. We are really slow at this especially on embedded Beagle.

We used to have support for libjpeg sub-sampling for 50%, 25% etc but after some digging it was removed in a bug fix in Feb 2010 RT-7536 so we need to put this back in. It turned out the old code was incorrect because it asked libjpeg for a exact fraction when the docs say only 1/1, 1/2, 1/4 and 1/8 are supported. 

I have attached a test case. Test numbers for before and after fix are:

BEAGLE 3.0

LOAD at 100% took = 3915ms
LOAD at 50% took = 8658ms
LOAD at 25% took = 6987ms
LOAD at 12.5% took = 5938ms
LOAD at 6.25% took = 5485ms
LOAD at 60x60 THUMBNAIL took = 5184ms

after fix

LOAD at 100% took = 3995ms
LOAD at 50% took = 1354ms
LOAD at 25% took = 630ms
LOAD at 12.5% took = 514ms
LOAD at 6.25% took = 590ms
LOAD at 60x60 THUMBNAIL took = 523ms

This shows a nice 8x to 10x improvement for all requested sizes 50% or less. On desktop this is only a 4x-5x but still nice.


Comments
Could somebody rerun it on beagle, and check, that in promoted build results are good?
04-09-2013

Fixed. Changeset: 49a01413754e Author: Chien Yang <chien.yang@orcale.com> Date: Thu Aug 30 14:27:52 2012 -0700 URL: http://jfxsrc.us.oracle.com/javafx/8.0/scrum/graphics/rt-closed/rev/49a01413754e
30-08-2012

Same good performance is observed on a very low-end ThinkPad-X120e laptop: Before fix: LOAD at 100% took = 2081ms LOAD at 50% took = 5186ms LOAD at 25% took = 3670ms LOAD at 12.5% took = 2918ms LOAD at 6.25% took = 2827ms LOAD at 60x60 THUMBNAIL took = 2493ms After fix: LOAD at 100% took = 2106ms LOAD at 50% took = 724ms LOAD at 25% took = 400ms LOAD at 12.5% took = 327ms LOAD at 6.25% took = 357ms LOAD at 60x60 THUMBNAIL took = 376ms
30-08-2012