xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Αναστάσιος Χαρούλης <tcharou...@gmail.com>
Subject Fop Performance degradation after upgrading from jdk 6 u18 to u19
Date Tue, 24 Apr 2012 06:27:26 GMT

We are using Apache FOP 1.0 to create Postscript documents from xml
files. After upgrading the Java Virtual Machine from 1.6 update 18 to
1.6 update 19, we noticed important performance degradation. The FOP
execution time was increased about 25% - 35% (depends on the number of
executions). After investigating this, we concluded that the code that
was responsible for this delay was in the method setValue of inner
class BeanSetter of class o.a.f.fonts.type1.AFPParser. This method
uses reflection to set the value of a bean and our tests showed that
the time to execute a reflection call like this was increased in jdk6
u19. We also noticed that for each FOP execution (instantiation of a
org.apache.fop.apps.Fop object) the fonts are loaded in memory (field
org.apache.fop.fonts.FontInfo in class AreaTreeHandler) .

We are wondering if there is a plan for caching the loaded fonts in an
object that is reused between successive executions (e.g. in the
org.apache.fop.apps.FopFactory). This would mean that the extra cost
would occur only in the first execution. Do you think this is a good
idea or is there a specific reason for the fonts not to be cached ?

If the fonts caching is not a good idea, do you think the use of
reflection in the BeanSetter class could be avoided?

Attached you may find a sample application that demonstrates the
issue. This application instantiates Fop and executes a conversion 200
times. The class file is foptest.FopTest. Libraries of FOP should
exist in the classpath.
(Execute java -cp ... foptest.FopTest in  the extracted folder)

Also in the class foptest.ReflectionTest it is demonstrated the
mentioned problem with the reflection call.

Note: There is no (noticed) performance degradation if only one conversion runs.

Thanks in advance,


View raw message