Bug 53148 - [PATCH] Fop Performance degradation after upgrading from jdk 6 u18 to u19
Summary: [PATCH] Fop Performance degradation after upgrading from jdk 6 u18 to u19
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: fonts (show other bugs)
Version: all
Hardware: PC All
: P2 enhancement
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-25 14:02 UTC by Tassos
Modified: 2012-04-25 15:42 UTC (History)
0 users



Attachments
patch Patch for class o.a.f.fonts.type1.AFMParser that improves performance & java source files that points the issue. (947.03 KB, application/x-zip)
2012-04-25 14:02 UTC, Tassos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tassos 2012-04-25 14:02:32 UTC
Created attachment 28684 [details]
patch Patch for class o.a.f.fonts.type1.AFMParser that improves performance & java source files that points the issue.

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, important performance degradation was observed. The FOP execution time was increased about 25% - 35%. 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.AFMParser. 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. 
In the attached files may be found a patch for class o.a.f.fonts.type1.AFMParser that improves performance. Also the attachment contains a Java file with a minimal fo and configuration that shows the issue. It contains a main class where fop converts the fo file to postscript 500 times.

Below may  be found the execution times for the provided test using the mentioned versions of Java (Windows 7 x64).
 
Java 6 update 18 it takes 30754 msec.
Java 6 update 19 it takes 54263 msec.

After applying the patch: 

Java 6 update 18 it takes 34240 msec.
Java 6 update 19 it takes 32501 msec.

The svn revision from which the patch was created is revision #1330050 from trunk.
Comment 1 Glenn Adams 2012-04-25 14:50:25 UTC
patch applied at http://svn.apache.org/viewvc?rev=1330317&view=rev

please let me know if this resolves the problem
Comment 2 Tassos 2012-04-25 15:42:21 UTC
Thank your for applying the patch. This resolves the issue.