You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by "Tory S. Anderson" <we...@toryanderson.com> on 2016/04/27 17:55:42 UTC

Embedded XML->PDF performance vs CLI: Why so slow?

This is also posted on SO[1], with the code. 

Using XML and XSL, in less than a second the CLI program produces 
the desired PDF. My embedded program in Clojure, which follows the 
example code (ExampleXML2PDF.java)  closely, uses the same XML and 
XSL to produce the same PDF -- but it takes it around a full 
minute. I've tried sifting through the example code to find places 
optimizations occur, but I'm hoping someone here can help me know 
how to get around the tremendous time sink that seems to occur 
with my transformer.transform call. 

Thanks,
- Tory

Footnotes: [1] 
http://stackoverflow.com/questions/36802128/embedding-fop-xml-to-pdf-why-so-slow-vs-cli

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


Re: Embedded XML->PDF performance vs CLI: Why so slow?

Posted by Alexios Giotis <al...@gmail.com>.
Hi Tory,

The execution time of ExampleXML2PDF.java & other examples in an IDE, is similar to the CLI version. Thus, there is no significant optimisation to do in the example code. I think this is due to running within a REPL but I have no Clojure skills to help you more on this. A profiler or frequent thread dumps should help locate where the time is consumed.  You could also execute the code 10 or more times in a loop and each time print the elapsed time to understand if the full minute is mostly a startup cost or a runtime cost. 


> On 27 Apr 2016, at 18:55, Tory S. Anderson <we...@toryanderson.com> wrote:
> 
> This is also posted on SO[1], with the code. 
> Using XML and XSL, in less than a second the CLI program produces the desired PDF. My embedded program in Clojure, which follows the example code (ExampleXML2PDF.java)  closely, uses the same XML and XSL to produce the same PDF -- but it takes it around a full minute. I've tried sifting through the example code to find places optimizations occur, but I'm hoping someone here can help me know how to get around the tremendous time sink that seems to occur with my transformer.transform call. 
> Thanks,
> - Tory
> 
> Footnotes: [1] http://stackoverflow.com/questions/36802128/embedding-fop-xml-to-pdf-why-so-slow-vs-cli
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 


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