• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Schema validation performance

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,


Has anyone had any issues with CPU usage when performing schema validation? I am investigating the possibility of this scenario but I am yet to be convinced that this is the case.

The code I am looking over makes use of a JAXP/DOM parser (DocumentBuilder) and applies the schema location by setting it as an attribute. Good details of how this is achieved can be found in to the article below:

http://www.onjava.com/pub/a/onjava/2004/09/15/schema-validation.html

The code seems to be constructed sensibly enough, however I was wondering what the thoughts were of schema validation, with regards to the best parser to use in that circumstance? SAX or DOM? Would SAX always be faster? The XML document is not particularly large.

Would it be advisable to use a grammer cache instead?

I welcome anyone's thoughts on this.

Cheers,


Stuart
 
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

best parser to use in that circumstance? SAX or DOM? Would SAX always be faster?



DOM builders actually use SAX parsers under the covers so SAX will be faster in all cases, and of course use the minium memory.

Bill
 
What's brown and sticky? ... a stick. Or a tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic