aspose file tools*
The moose likes XML and Related Technologies and the fly likes Java Xml parser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Java Xml parser" Watch "Java Xml parser" New topic
Author

Java Xml parser

sudarsana reddy
Greenhorn

Joined: Mar 18, 2008
Posts: 3
Hi All

Can you please share a code base of fastest java xml parser to java beans ? I have a requirement as we need to process a 10000 messages in 3-4 secs some thing like that.

Thanks
Sudarsan
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
When we first started seeing XML parsers in Java there was a LOT of effort put into speeding them up. That was a long time ago. I think you can rely on the standard library parsers as being quite fast.

I suspect that processing time is going to be dominated by other decisions.

I would bet that using a SAX or Stax parser input with hand optimized bean creation will be LOTS faster than using the java.beans.XMLDecoder API. (and use less memory too)

How complex is your target "bean" object?

Bill

sudarsana reddy
Greenhorn

Joined: Mar 18, 2008
Posts: 3
I have around 100 properties in my bean. I will get input from a ESB as xml . Before processing trading xml we need to store in a db and load the data from db and process trade data.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

When trying to optimize things -- let's say speeding them up, since you said "fastest" -- you should normally target the parts of the things which take the most time.

It doesn't appear you have done your basic homework yet. Have you established that of this series of events (database updating, XML parsing, data processing), the XML parsing takes the most time? Or did you just pick on the XML parsing randomly?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5

++ to Paul's comment on basic homework. I get the impression that DB updating is the slowest thing by far in applications like this but you really need to start measuring.

Do you really need the "bean" style interface Java object at all, or is that a requirement?

For fun browsing, google "premature optimization root of all evil"

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Xml parser