RE: DOM or SAX?
u were right, Saxon wasn't any faster with my PDF generation. -Original Message- From: J.Pietschmann [mailto:[EMAIL PROTECTED] Sent: Monday, June 17, 2002 6:52 PM To: [EMAIL PROTECTED] Subject: Re: DOM or SAX? Argyn Kuketayev wrote: Are you sure the parser is the bottleneck? no. I'm not sure. But I want to try another parser first, since it seems the easiest thing to do. Easy or not, the time spent on replacing the parser is most likely wasted. Get a good profiler and *measure* where your program uses processor cycles. I'm pretty sure that you'll find the parser uses only neglible ressources. I didn't find how to configure FOP to run with parsers from Saxon 6.5.2 distribution. Can I get any help on that? I just use saxon.jar instead of xalan.jar+xerces.jar without any problem. I used 6.5. J.Pietschmann
RE: DOM or SAX?
u were right, Saxon wasn't any faster with my PDF generation. Easy or not, the time spent on replacing the parser is most likely wasted. Just as an FYI to anybody interested, the version of the parser does seem to make a difference. I was using Xalan 2.1.0 as the SAX parser, and as the size of the XML increased, the average rendering time per page using FOP increased. When I switched to Xalan 2.3.1, the rendering time per page stayed the same regardless of how big the XML was.
Re: DOM or SAX?
[EMAIL PROTECTED] wrote: Just as an FYI to anybody interested, the version of the parser does seem to make a difference. I was using Xalan 2.1.0 as the SAX parser, and as the size of the XML increased, the average rendering time per page using FOP increased. When I switched to Xalan 2.3.1, the rendering time per page stayed the same regardless of how big the XML was. You are talking about the XSLT processor, not about an XML parser. The most likely explanation is that the older Xalan builds an internal tree representation of the whole XML and then processes it, thereby perhaps trying to apply templates to every node. The newer Xalan probably uses by default streaming processing, which analyzes the templates statically (during style sheet compilation) and can decide from this whether templates can be applied to a certain node without having read the whole XML. This decreases memory load and can speed up processing considerably. As for parsers, the only real trap to watch out is to check for a DOCTYPE declaration, especially if it points to a DTD on a non-local file system or (yuk!) retrieved by HTTP (the dreaded XHTML DTD link). Complicated DTDs like full DocBook take a lot of time to read and parse even if fetched from local storage. Enabled validation may also waste some additional processor cycles, but XSLT proccessors usually take care to prevent this. J.Pietschmann
Re: DOM or SAX?
Argyn Kuketayev wrote: Which parser does FOP use when launched from command-line? SAX or DOM ? Xerces implements both APIs. You should be able to use any Java parser which implements SAX2 and has namespace support. Being able to switch validation off is a bonus. I use FOP with the hacked up AElfred parser distributed with Saxon regularly. You can also feed DOM documents to an embedded FOP. J.Pietschmann
RE: DOM or SAX?
thanks. when I run FOP with dumping option, it says that SAX parser is used. I use FOP with the hacked up AElfred parser distributed with Saxon regularly. what's the fastest parser in your opinion? we are facing performance problems, I've to speed up the current configuration 4 times, or at least 2 times. Argyn
Re: DOM or SAX?
Argyn Kuketayev wrote: what's the fastest parser in your opinion? we are facing performance problems, I've to speed up the current configuration 4 times, or at least 2 times. Are you sure the parser is the bottleneck? FOP uses a huge amount of ressources for certain layout features. Network file systems and other processes forcing swapping are also candidates. Do a solid profiling before fiddling with minor details like a parser implementation. J.Pietschmann
RE: DOM or SAX?
Are you sure the parser is the bottleneck? no. I'm not sure. But I want to try another parser first, since it seems the easiest thing to do. I didn't find how to configure FOP to run with parsers from Saxon 6.5.2 distribution. Can I get any help on that? Argyn