Lee, Insoo wrote:
I'm generating XML on the fly from my servlet (line# 9 - using jdom,
reading from database) and after reading static XSL (line#7), I use
transformer to do XSL:FO translation (line#21). However line#21 seems to be
taking awfully long.... about 5 minutes for 1500 rows of records...
Is there anyway to improve the performance? Thanks for your input in
advance
First of all upgrade FOP software up to the latest version, performance was
improved to some degree in the 0.20.5rc.
The rest is a stylesheet author responsibility - generate optimal fo
structure. Here are some tips from FOP's faq[1]:
# Avoid forward references. Forward references cause all pages from the page
with the reference on to be held in memory until the page with the referenced
element is encountered. Common forward references are table of contents at the
beginning of the document and the "page N of TOTAL" in footers. Forward
references may be required by the task, however, if you are getting a memory
overflow you should at least check whether this is really as necessary as
claimed. A TOC, for example, could often be placed at the end of the document
without dimishing it's value too much, the paper can be reshuffled after
printing, and you can use bookmarks in PDF.
# Avoid large images, especially if they are scaled down. Scale them outside
of FOP and use the already scaled images for the FOP run. For many image
formats it is mainly the size of the image file which matters, not
width*height, so you can try other means like using a higher compression rate.
# Use multiple page sequences. FOP starts rendering after the end of a page
sequence is encountered. While the actual rendering is done page by page, some
memory allocated for other purposes could possibly be freed after the page
sequence has been rendered.
[1] http://xml.apache.org/fop/faq.html
--
Oleg Tkachenko
eXperanto team
Multiconn Technologies, Israel
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list