<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1256">
<META content="MSHTML 5.50.4916.2300" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=Verdana size=2>No, I parse directly from a file (without having
a pre-built DOM tree).</FONT></DIV>
<DIV><FONT face=Verdana size=2>And what I see is that using the deprecated
method DOMBuilder.build(File)</FONT></DIV>
<DIV><FONT face=Verdana size=2>is significantly faster than
SAXBuilder.build(File). </FONT></DIV>
<DIV><FONT face=Verdana size=2></FONT> </DIV>
<DIV><FONT face=Verdana size=2>Intuitively I agree with you that it *should* be
the opposite - But is this</FONT></DIV>
<DIV><FONT face=Verdana size=2>"theoritical" statement confirmed by the practice
or benchmarks ?</FONT></DIV>
<DIV><FONT face=Verdana size=2></FONT> </DIV>
<DIV><FONT face=Verdana size=2>> DOM Xerces 2.0.1
|
88.8
| 456.1</FONT></DIV>
<DIV><FONT face=Verdana size=2>for: new
DOMBuilder(false).build(this.file);</FONT></DIV>
<DIV><FONT face=Verdana size=2><BR>> SAX Xerces 2.0.1
|
196.3
| 2280.7</FONT></DIV>
<DIV><FONT face=Verdana size=2>for: new
SAXBuilder("org.apache.xerces.parsers.SAXParser",
false).build(this.file);</FONT></DIV>
<DIV><FONT face=Verdana size=2><BR>> SAX Piccolo 1.02
|
158.6
| 2111.7</FONT><BR><FONT face=Verdana
size=2>for: new SAXBuilder("com.bluecast.xml.Piccolo",
false).build(this.file);<BR></DIV></FONT>
<DIV><FONT face=Verdana size=2></FONT> </DIV>
<DIV><FONT face=Verdana size=2>----- Original Message ----- </FONT>
<DIV><FONT face=Verdana size=2>From: "Alex Rosen" <</FONT><A
href="mailto:arosen@silverstream.com"><FONT face=Verdana
size=2>arosen@silverstream.com</FONT></A><FONT face=Verdana
size=2>></FONT></DIV>
<DIV><FONT face=Verdana size=2>To: "'Martial Doré'" <</FONT><A
href="mailto:martial.dore@laposte.net"><FONT face=Verdana
size=2>martial.dore@laposte.net</FONT></A><FONT face=Verdana size=2>>;
<</FONT><A href="mailto:jdom-interest@jdom.org"><FONT face=Verdana
size=2>jdom-interest@jdom.org</FONT></A><FONT face=Verdana
size=2>></FONT></DIV>
<DIV><FONT face=Verdana size=2>Sent: Thursday, May 30, 2002 16:00</FONT></DIV>
<DIV><FONT face=Verdana size=2>Subject: RE: [jdom-interest] Performance SAX
versus DOM</FONT></DIV></DIV>
<DIV><FONT face=Verdana><BR><FONT size=2></FONT></FONT></DIV><FONT face=Verdana
size=2>> DOMBuilder hasn't been deprecated - the methods that act on a file
or stream<BR>> have been deprecated. These methods should be slower than
using SAXBuilder,<BR>> because DOMBuilder first has to read the file and turn
it into a DOM tree,<BR>> and then turn that DOM tree into a JDOM tree.
SAXBuilder just reads the file<BR>> and turns it directly into a JDOM
tree.<BR>> <BR>> On the other hand, if you already have a DOM tree, then
using DOMBuilder is<BR>> fine. Is that what you're doing here?<BR>>
<BR>> Alex<BR>> <BR>> -----Original Message-----<BR>> From:
</FONT><A href="mailto:jdom-interest-admin@jdom.org"><FONT face=Verdana
size=2>jdom-interest-admin@jdom.org</FONT></A><FONT face=Verdana size=2>
[mailto:jdom-interest-admin@jdom.org]On<BR>> Behalf Of Martial Doré<BR>>
Sent: Thursday, May 30, 2002 7:16 AM<BR>> To: </FONT><A
href="mailto:jdom-interest@jdom.org"><FONT face=Verdana
size=2>jdom-interest@jdom.org</FONT></A><BR><FONT face=Verdana size=2>>
Subject: [jdom-interest] Performance SAX versus DOM<BR>> <BR>> <BR>>
Hi,<BR>> <BR>> In beta 8, DOMBuilder has been deprecated as its javadoc
says :<BR>> "The class can be used to build from files, streams, etc but
other builders<BR>> like SAXBuilder can perform the task faster because they
don't create a DOM<BR>> tree first."<BR>> <BR>> However, in our case,
SAXBuilder is 2x (small files) to 4x (larger files)<BR>> slower.<BR>>
<BR>>
| 170 files 2kb-4kb | 87 files 6kb-43kb<BR>> DOM Xerces
2.0.1 |
88.8
| 456.1<BR>> SAX Xerces
2.0.1 |
196.3
| 2280.7<BR>> SAX Piccolo
1.02 |
158.6
| 2111.7<BR>> <BR>> The numbers are
average/file in ms, on VisualAge VM, with non-validating<BR>>
parsers.<BR>> <BR>> Moreover, reading then all the nodes of the document
for creating<BR>> our object structure is 25% faster if it has been built
with DOMBuilder...<BR>> <BR>> Is there something I missed in my
configuration or is there specific<BR>> performance issues<BR>> with
SAXBuilder ?<BR>> <BR>> Thanks,<BR>>
Martial<BR>> <BR>>
_______________________________________________<BR>> To control your
jdom-interest membership:<BR>> </FONT><A
href="http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com"><FONT
face=Verdana
size=2>http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com</FONT></A><BR><FONT
face=Verdana size=2>> <BR>> </FONT></BODY></HTML>