XSD validation performance
Friday, 27 July 2012 · 2 messages
SG
Seenivasan Gunabalan27 Jul 2012 12:37 #
Hi,
I have encountered an performance issue while validating xml(5kb) against xsd's(12kb). It took nearly 30 seconds for the validation. As baseX is using java API's, we did the same validation using simple java. we noticed that the caching of schema object reduces the time significantly(from 30 seconds to 8 milli seconds.). Is there a place where we could configure to enable/diable caching of schema or it needs the code to be re-factored or is there a workaround?
Thanks,
Seenivasan
DK
Dirk Kirsten27 Jul 2012 12:53 #
Dear Seenivasan,
Would you be so kind to provide your executed query and even better the xml file to validate and the schema (you can also send it to me privately)? As I have a query were I validate a xml file of about 150kb against a much larger xsd (~300kb + including other xsds of about 500kb) which takes only some ms, I can not reproduce your issue with the provided information. It might be something specific to your xsd.
There is currently no caching of the xsd internally. What you could do is to store the content of the schema in a variable and then use this node() as input of the
validate:xsd() function. Please see [1] for the documentation of this function, which also states this possibility.
Cheers,
Dirk
[1] http://docs.basex.org/wiki/Validation_ModuleQuoted text · Seenivasan Gunabalan · 18 lines
On Fri, Jul 27, 2012 at 12:37 PM, Seenivasan Gunabalan < seenivasan.gunabalan at dedalus.eu> wrote: > Hi, > I have encountered an performance issue while validating xml(5kb) > against xsd's(12kb). It took nearly 30 seconds for the validation. As baseX > is using java API's, we did the same validation using simple java. we > noticed that the caching of schema object reduces the time > significantly(from 30 seconds to 8 milli seconds.). Is there a place where > we could configure to enable/diable caching of schema or it needs the code > to be re-factored or is there a workaround? > > Thanks, > Seenivasan > ______________________________**_________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-**konstanz.de <BaseX-Talk at mailman.uni-konstanz.de> > https://mailman.uni-konstanz.**de/mailman/listinfo/basex-talk<https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk> >
Written for BaseX 7.3. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery