xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J.Pietschmann" <j3322...@yahoo.de>
Subject Re: Why is FOP MUCH slower the first time than all other runs?
Date Fri, 06 Feb 2004 21:12:17 GMT
Robert Paris wrote:
> I don't think it's the tomcat issue, it takes a long time the first time 
> even when I call it from a java class (if the class creates a pdf then 
> creates another one before exiting, the second one is much faster). It's 
> got to be in the FOP. Is there a way to fix this?

1. It has to load all the classes from the jars.
2. Some static data is set up while loading classes, for example
  the tables mapping the FO names to factories. There's a lot of
  object creation and such going on at this time.
The current implementation has certainly room for improvement.
Several ideas have been discussed, here as well as for other
software facing similar problems. Unfortunately, Java doesn't
allow for really static memory initialization like C/C++ does,
which, together with the lack of plain function pointers, makes
further optimization of the mapping tables somewhat difficult.

If you have ideas, please post.

Well, the static data as well as various instance data is quite
often initialized too eagerly. I'll be indebted to anyone who
scrutinizes the whole setup for places where postponing creating
a variety of ArrayLists and HashTables is a win. IIRC in the
example I used for tracking down the table area problems there
were 800000 HashTables created, of which only 200000 ever saw an
element put into it (the average number of elements for hash
tables with at elast one element was less than 1.2).


To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org

View raw message