Peter B. West wrote:
Keiron Liddle wrote:

On Fri, 2002-12-06 at 03:47, Peter B. West wrote:

If anyone else want to have a look I would be interested in the results. I am particularly interested in memory usage, which, prima facie, looks good. 9 megs total memory usage for 51 pages of FO tree sounds very encouraging to me, although I have called these preliminary because I am not certain that everything that needs to be created has been created.

I don't know how much you know about it, but in HEAD Karen added
whitespace handling that reduces the whitespace as it is processed (eg.
when a block ends).

I get about 17.5Mb for that document. I don't know what is using it all
but there are lots of variables that are not being used.

Unfortunately, since FOP was changed to trigger layout on the end element of a page-sequence, no complete FO tree is built in the current versions. There are, however, only two page sequences in the fo file, so the simple solution may be to remove the the smaller of these for the comparisons.


Using the current maint version, I made the following modifications:

Forced GC for memory profiling
Moved time calculation ahead of GC (it takes over 1.2 seconds)
- in
Commented out the call to render()
Allowed page-sequence FO subtree to be added to the FO tree
- in

Compiled and run under j2sdk-1.4.1 and build.compiler=jikes.

Obviously all of the renderer setup code is still present, including font setup, and as you say, there are no doubt variables which are initialised for the rendering.

Results (fastest of three successive runs):

[DEBUG] Input mode:
[DEBUG] fo input file: /home/pbw/public_html/xml/
[DEBUG] Output mode:
[DEBUG] pdf
[DEBUG] output file: /tmp/51.pdf
[DEBUG] no user configuration file is used [default]
[DEBUG] debug mode on
[DEBUG] dump configuration
[DEBUG] quiet mode on
[INFO] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser
[INFO] base directory: file:/home/pbw/public_html/xml/
[INFO] FOP 0.20.5cvs
[INFO] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser
[INFO] building formatting object tree
[INFO] setting up fonts
[INFO] Parsing of document complete, stopping renderer
[DEBUG] Total time used: 17159ms
[DEBUG] Pages rendered: 0
[DEBUG] Initial heap size: 497Kb
[DEBUG] Current heap size: 16922Kb
[DEBUG] Total memory used: 16425Kb

The equivalent figures from my original post are:
Initial heap size: 352Kb
Current heap size: 8879Kb
Total memory used: 8527Kb

The comparable time is the elapsed time before preorder scan:

I have just run some quick test of property generation, to determine whether I was actually generating the property sets for the FOs. Although there are obviously still some bugs in property generation, the full property sets are being generated.

I don't think that almost halving the memory usage of the FO tree build can be accounted for by "unused variables" in the maint code. Rather, it seems that the rewrite of FO tree building and property representation has achieved its design goal: significantly reduced memory usage.

To my surprise, it also runs faster, in spite of using an admittedly less efficient pull parsing method implemented over the top of SAX. Taking advantage of native pull parsing APIs when they become available (and the Neko pull parser is slated for release with Xerces soon) will increase the performance.

Now if I can work out Forrest, I'll update the documentation.

"Lord, to whom shall we go?"

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to