When you use the schema cache functionality, you can reduce the parsing time for validation. However, the problems such as increase in the memory usage or when the disk cache is used, the expected effects might not output.
This subsection describes how to avoid such problems and use the appropriate schema cache.
A schema document is coded with XML. The parsing is performed before the validation check, and converted to internal grammar objects. Using cache, you can omit the processing of setting the grammar objects from the schema document. The following time is required for parsing the validation check:
validation-time-of-the-instance-document + time-for-setting-grammar-objects-from-schema-document
The time required for setting grammar objects can be omitted from the cache, so the effect of the schema cache as displayed in the first condition will be more in the following conditions:
When using the schema cache functionality, grammar objects are set up from the schema document in advance, so you can omit the time required for setting the grammar objects during the validation.
However, when the memory and the disk cache are used, the time required for parsing the validation check is as follows:
When using the memory cache, after a cache is setup, the cache remains in the memory. Therefore, adjust the memory usage within the permitted range of resources. It is effective to select a schema document that is frequently used, and then using the memory cache with the priority.