[jdom-interest] Build From a String Performance Problem?

Michael Skells mskells at aspirebanking.com
Fri Dec 15 00:29:12 PST 2000


It is instantanious for me after the first run

On the first run there is the overhead of classloading, JIT compilation
etc

public class Main extends Object {
    
    /** Creates new Main */
    public Main () {
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main (String args[]) {
        try{
            long time = System.currentTimeMillis();
            String sXML = "<TestX><Val1>some value</Val1></TestX>";
            Document doc = new org.jdom.input.SAXBuilder().build(new
StringReader(sXML));
            System.out.println((System.currentTimeMillis() - time));
            time = System.currentTimeMillis();
            doc = new org.jdom.input.SAXBuilder().build(new
StringReader(sXML));
            System.out.println((System.currentTimeMillis() - time));
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    
}

gives the results


1609
0


what does it do on you system.

 
> -----Original Message-----
> From: McFarland, Todd [mailto:Todd.McFarland at fmr.com]
> Sent: 14 December 2000 17:43
> To: 'jdom-interest at jdom.org'
> Subject: [jdom-interest] Build From a String Performance Problem?
> 
> 
> 
> 
> >  -----Original Message-----
> > From: 	McFarland, Todd  
> > Sent:	Thursday, December 14, 2000 11:28 AM
> > To:	'jdom-interest at jdom.org'
> > Subject:	Build From a String Performance Problem?
> > 
> > 
> > I think I'm missing something here!
> > The second line of code takes about 3 seconds to execute, 
> which makes the
> > parser unusable for me.
> > The microsoft parser however, is instantanious.  Can anyone comment?
> > 
> > String sXML = "<TestX><Val1>some value</Val1></TestX>";
> > Document doc = new org.jdom.input.SAXBuilder().build(new
> > StringReader(sXML));
> > 
> > Thanks,
> > - Todd
> > 
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/yo
uraddr at yourhost.com



More information about the jdom-interest mailing list