Response from Mike did not make it to
the saxon-help list, therefore I am reposting it:
Thanks for the enquiry. We haven't done detailed performance tests
on schema loading but we are aware that there is lots of room for
improvement and I'm hoping we can schedule some work on this soon.
With large schemas it's often the case that large parts of the
schema are unused and a considerable saving might be possible by
doing lazy validation/compilation of components.
In the meantime the best I can suggest is to look at SCM, the
schema component model. The Validate command allows you to output
a .scm file containing the schema in compiled form, and this
should be significantly faster to load than the original source
schema documents. Of course this assumes that you are using the
same schema repeatedly.
cc O'Neil Delpratt
On 04/06/13 18:27, Peter Cowan wrote:
I'm using Saxon 9.5EE (under Java 1.6) to perform a large number of
schema aware XPath evaluations on xml documents.
The schemas I'm using are composite, around 3.4mb and are already in
memory provided by an API as DOM (backed by Xerces).
In some independent tests I've tried loading the schemas from in memory
DOMSources and StreamSources (backed by ByteArrayInputStreams) using the
load method on the Schema Manager object which takes about 3.8 seconds.
I then ran a similar test building a Schema with Xerces from the same in
memory sources and this took about 800ms
Regrettably we have to load the schema twice but ideally would like it
to be as fast as possible.
Are these kind of speeds normal?
Are there any tips to improve schema loading speed?
Do you require more information to answer the former questions?