United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6354112 : increase compiler optimization level for libjpeg to improve runtime performance

Details
Type:
Bug
Submit Date:
2005-11-22
Status:
Resolved
Updated Date:
2008-02-05
Project Name:
JDK
Resolved Date:
2005-12-05
Component:
client-libs
OS:
solaris_9
Sub-Component:
javax.imageio
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
5.0
Fixed Versions:

Related Reports

Sub Tasks

Description
This request is similar to that in 6350086: libjpeg in the JDK is built with
default compiler optimization flags.  By increasing it to a higher level, some
tests which exercise the native IJG JPEG libraries can run a few percent faster.

                                    

Comments
EVALUATION

As per description.  If we move all the way up to CC_HIGHEST_OPT, we get a
reasonable boost in performance (esp. on Windows) at the cost of a slight increase
in library size (on windows-i586, jpeg.dll goes from 122880 bytes to 147456).

For example, here are some J2DBench test results taken on 2x 2.8 GHz P4, 1GB RAM,
-client, -Xms256M -Xmx512M:
imageio.input.image.imageio.reader.tests.read,imageio.opts.size=1000:
base: 18010.29159 (var=0.5%) (100.0%)
test: 19841.72496 (var=0.72%) (110.17%)
imageio.input.image.imageio.reader.tests.read,imageio.opts.size=20:
base: 1498.279479 (var=0.17%) (100.0%)
test: 1535.490456 (var=0.48%) (102.48%)
imageio.input.image.imageio.reader.tests.read,imageio.opts.size=4000:
base: 17174.29223 (var=3.21%) (100.0%)
test: 19120.96667 (var=0.41%) (111.33%)

Similar gains are seen for the JPEGCodec and Toolkit tests (since they all share
the same native library, jpeg.dll).
                                     
2005-11-22
EVALUATION

Here are the full results ("base" is the default, CC_LOWER_OPT, "higher" is
CC_HIGHER_OPT, "highest" is CC_HIGHEST_OPT, -client, -Xms256M -Xmx512M in all
cases).  The first numbers in each group shows the increase in size of libjpeg
for that particular platform.

solaris-sparc, SB2000, 900 MHz USIII, 1GB RAM:
CC_LOWER_OPT:   278552
CC_HIGHER_OPT:  318512 (+14%)
CC_HIGHEST_OPT: 325212 (+17%)
imageio.input.image.imageio.reader.tests.read,imageio.opts.size=20:
base: 715.7626287 (var=16.44%) (100.0%)
higher: 806.5375040 (var=1.29%) (112.68%)
highest: 814.2657643 (var=0.57%) (113.76%)
imageio.input.image.imageio.reader.tests.read,imageio.opts.size=1000:
base: 5932.671081 (var=54.61%) (100.0%)
higher: 6720.583209 (var=0.37%) (113.28%)
highest: 6704.545454 (var=0.14%) (113.01%)
imageio.input.image.imageio.reader.tests.read,imageio.opts.size=4000:
base: 4274.646005 (var=21.99%) (100.0%)
higher: 4405.892881 (var=1.27%) (103.07%)
highest: 4363.239705 (var=1.65%) (102.07%)

solaris-i586, W2100z, 2x 2.0 GHz Opteron, 2GB RAM:
CC_LOWER_OPT:   264468
CC_HIGHER_OPT:  327784 (+24%)
CC_HIGHEST_OPT: 332668 (+26%)
imageio.input.image.imageio.reader.tests.read,imageio.opts.size=20:
base: 2366.841725 (var=0.31%) (100.0%)
higher: 2478.230452 (var=0.09%) (104.71%)
highest: 2538.540596 (var=0.33%) (107.25%)
imageio.input.image.imageio.reader.tests.read,imageio.opts.size=1000:
base: 14653.59336 (var=0.14%) (100.0%)
higher: 15109.47528 (var=0.04%) (103.11%)
highest: 14820.42405 (var=0.22%) (101.14%)
imageio.input.image.imageio.reader.tests.read,imageio.opts.size=4000:
base: 13152.48664 (var=0.18%) (100.0%)
higher: 13485.04003 (var=0.11%) (102.53%)
highest: 13374.19894 (var=0.2%) (101.69%)

windows-i586, 2x 2.8 GHz P4, 1GB RAM:
CC_LOWER_OPT:   122880
CC_HIGHER_OPT:  147456 (+20%)
CC_HIGHEST_OPT: 147456 (+20%)
imageio.input.image.imageio.reader.tests.read,imageio.opts.size=20:
base: 1551.237935 (var=0.99%) (100.0%)
higher: 1593.298647 (var=0.32%) (102.71%)
highest: 1600.253458 (var=0.67%) (103.16%)
imageio.input.image.imageio.reader.tests.read,imageio.opts.size=1000:
base: 18101.49768 (var=1.35%) (100.0%)
higher: 19965.46514 (var=0.84%) (110.3%)
highest: 20154.37392 (var=0.34%) (111.34%)
imageio.input.image.imageio.reader.tests.read,imageio.opts.size=4000:
base: 17355.93220 (var=0.22%) (100.0%)
higher: 19200.0 (var=0.0%) (110.62%)
highest: 19241.04756 (var=0.43%) (110.86%)

linux-i586, 2x 733 MHz P3, 256 MB RAM:
CC_LOWER_OPT:   182816
CC_HIGHER_OPT:  210931 (+15%)
CC_HIGHEST_OPT: 210931 (+15%)
imageio.input.image.imageio.reader.tests.read,imageio.opts.size=20:
base: 657.8912021 (var=0.09%) (100.0%)
higher: 680.8606006 (var=0.11%) (103.49%)
highest: 660.4515984 (var=5.68%) (100.39%)
imageio.input.image.imageio.reader.tests.read,imageio.opts.size=1000:
base: 4977.540366 (var=0.18%) (100.0%)
higher: 4965.019183 (var=0.2%) (99.75%)
highest: 5003.573981 (var=0.19%) (100.52%)
imageio.input.image.imageio.reader.tests.read,imageio.opts.size=4000:
base: 2662.672657 (var=83.93%) (100.0%)
higher: 2662.229617 (var=83.22%) (99.98%)
highest: 2635.914332 (var=31.48%) (99.0%)

Looks like not much benefit on linux-i586.
                                     
2005-11-22



Hardware and Software, Engineered to Work Together