Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8125256

JPEG loading is really slow for thumbnails


    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 8
    • Component/s: javafx


      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.


          Issue Links



              • Assignee:
                ckyang Chien Yang (Inactive)
                jasper Jasper Potts
              • Votes:
                0 Vote for this issue
                3 Start watching this issue


                • Created: