[jdom-interest] Speed!? JDOM vs DOM
Gary Bentley
gb at opengroup.org
Tue Mar 6 07:23:45 PST 2001
I've found that once the classes are loaded into the VM it then takes next
to no time to load another file...
I've had a 15K file parsed and converted to a Document in 30
milliseconds...I couldn't believe it so I put it into a loop and re-loaded
it a couple of hundred times...
I am using the default Crimson parser (JDOM 6), it's smaller and seemingly
faster than the xerces parser.
Actually does anyone have any figures on size of XML file as opposed to
conversion to Document time?
G.
-----Original Message-----
From: jdom-interest-admin at jdom.org
[mailto:jdom-interest-admin at jdom.org]On Behalf Of Rolf Kluge
Sent: Tuesday, March 06, 2001 4:23 PM
To: jdom-interest at jdom.org
Subject: Re: [jdom-interest] Speed!? JDOM vs DOM
On Die, 06 Mdr 2001, Jason Hunter wrote:
> Rolf Kluge wrote:
> >
> > //
> > // For building org.jdom.Document.
> > //
> > FileInputStream in = new FileInputStream(filename);
> > SAXBuilder b;
> > b = new SAXBuilder("org.apache.xerces.parsers.SAXParser");
> > Document jdoc = b.build(in);
> >
> > /* This takes about 12 sec. */
>
> It'd help if you buffered the input stream.
>
> -jh-
Not really! I try it with ...
//
FileInputStream in = new FileInputStream(filename);
BufferedInputStream bin = new BufferedInputStream(in);
builder = new SAXBuilder(saxDriverClass);
Document jdoc = builder.build(bin);
//
.. but it takes nearly the same time (11,5 sec).
??
______________________________________________________________________
Rolf Kluge mailto:rolf at smb-tec.com
SMB GmbH http://www.smb-tec.com
--
______________________________________________________________________
Rolf Kluge mailto:rolf at smb-tec.com
SMB GmbH http://www.smb-tec.com
_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com
More information about the jdom-interest
mailing list