• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Java Xml parser

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 28346
97
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

++ 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 promise I will be the best, most loyal friend ever! All for this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic