Jaume, please put a loop around the test and perform it at least 5 times.
I strongly believe that you're seeing a lot of influence by the class
loader and the JIT here. Xerces is a much larger package and will take
longer to load. I'm sure your values will change quite a bit with the
loop.

On 23.09.2005 17:03:14 Xaus, Jaume wrote:
> Dear Jay,
> 
> We expended a lot of time in many test about this two libraries. :-)
> 
> Two test was performed in the exactily same conditions.
> 
> This is the code used in test :
> 
> public class TestFop {
>   public TestFop() {
>     String[] clo = {"-d", "-pdf", "/test/prova.pdf", "-xml", "/test/per.xml", 
> "-xsl","/test/ReportGeneric.xsl"};
> 
>     try {
>       long heapSize = Runtime.getRuntime().totalMemory();
>       long heapMaxSize = Runtime.getRuntime().maxMemory();
>       long heapFreeSize = Runtime.getRuntime().freeMemory();
>       Date ini = new Date();
>       System.out.println("Tamany heap : "+heapSize);
>       System.out.println("Maxim heap : "+heapMaxSize);
>       System.out.println("LLiure heap : "+heapFreeSize);
> 
>       Fop.main(clo);
> 
>       heapSize = Runtime.getRuntime().totalMemory();
>       heapMaxSize = Runtime.getRuntime().maxMemory();
>       heapFreeSize = Runtime.getRuntime().freeMemory();
>       System.out.println("Tamany heap : "+heapSize);
>       System.out.println("Maxim heap : "+heapMaxSize);
>       System.out.println("LLiure heap : "+heapFreeSize);
>       Date fin = new Date();
>       long sec = (fin.getTime()-ini.getTime())/1000;
>       String hola = "Temps = "+sec+" segonds.";
>     }
>     catch (Exception ex) {
>       ex.printStackTrace();
>     }
>   }
> 
>   public static void main(String[] args) {
>     TestFop testfop = new TestFop();
>   }
> 
> Parametres JVM : -Xms128m -Xmx512m
> Size of file per.xml : 501 kb
> Lines of file per.xml : about 4.000 lines
> Pages generated in file prova.pdf : 117 pages
> 
> Time with Xerces  : 1637 seconds
> Time with Crimson : 66 seconds
> 
> Everybody could test yourself if he would !
> 
> Salutations
> 
>    
> 
> -----Mensaje original-----
> De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Enviado el: viernes, 23 de septiembre de 2005 16:56
> Para: [email protected]
> Asunto: Re: FOP improvement up to 3000%.
> 
> Were the conditions of the two runs exactly the same? For example, if you 
> were timing the first run of the Xerces parser and the second run of the 
> Crimson parser, caching could account for much of the difference.
> 
> Also, such items as configuration differences can have a large impact. If you 
> were using the default amount of memory, perhaps Xerces would benefit from a 
> change in that setting while Crimson may be more efficient in its use of 
> memory and not suffer from using the default. Thus, changing configuration 
> could account for at least some of the difference. Your mention that "This 
> library give very poor performance where xml file is large" makes me think 
> memory may be part of the difference.
> 
> I'm sure other issues could factor into it as well.
> 
> Of course, Crimson may simply be a much faster parser. I have heard good 
> things about Crimson from a number of quarters.
> 
> Jay Bryant
> Bryant Communication Services
> (presently consulting at Synergistic Solution Technologies)
> 
> 
> 
> 
> 
> "Xaus, Jaume" <[EMAIL PROTECTED]>
> 09/23/2005 05:50 AM
> Please respond to
> [email protected]
> 
> 
> To
> <[email protected]>
> cc
> 
> Subject
> FOP improvement up to 3000%.
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>  
> Dear friends,
>  
> We are using FOP api in order to build PDF documents from large Xml files.
>  
> The FOP package distribution contains Xerces as xml parser. ([Debug] Using 
> org.apache.xerces.parsers.SAXParser as SAX2 Parser)
>  
> This library give very poor performance where xml file is large.
>  
> We improved up to 3000% the performance simplement changin Xerces for 
> Crimson library.([Debug] Using org.apache.crimson.parser.XMLReaderImpl as 
> SAX2 Parser)
>  
> Does anyone know the reason off this performance difference ?
> Thanks  
>  
> 
> 
> 
> Jaume Xaus
> Director Departament Java
> [EMAIL PROTECTED]
> 
> 
> “La confianza, como el arte, nunca proviene de tener todas las respuestas, 
> sino de estar abierto a todas la preguntas.” 
> Earl Gray Stevens.
>  
> 
> 
>  
> 
>  
> 
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.11.5/110 - Release Date: 22/09/2005
> 
> 
> -- 
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.11.5/110 - Release Date: 22/09/2005
>  
> 
> -- 
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.11.5/110 - Release Date: 22/09/2005
>  
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



Jeremias Maerki


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

Reply via email to