-
Enhancement
-
Resolution: Future Project
-
P3
-
5.0
-
generic
-
generic
Various benchmarks around FI and JAXB shows that Xerces is slow with smaller documents.
One of the reasons for this is that it takes a lot of time to reset a parser. Currently,
Xerces' internal infrastructure is designed so that the reset method to components inside
a parser would trigger a large number of XMLComponentManager.getProperty/getFeature.
This uses a string as a key, and the implementation of this method typically does a large
number of comparisons. This is slow, and this is redundant because almost all the time the
caller knows exactly what it wants.
Many of that work can be potentially replaced by a single field access of the form
xmlComponentManager.errorReporter
At least for the major components such as error-reporter.
Furthermore, in a sense, the idea of having each component to keep references to
other components individually is a bad idea when you think of performance. There only needs
to be one component that has references to all the other components, and everyone can ask
for that to obtain a reference.
Another design problem is that when a component manager doesn't know of a property/feature,
it throws an exception. The caller needs to always catch this exception. Throwing an exception
is a very costly operation, and setting up try-catch block is also not free.
I assume that this is a substantial change to XNI, so I understand if the JAXP team
is not willing to make this kind of changes, but I thought I should raise the issue
anyway.
###@###.### 2005-05-11 17:09:50 GMT
One of the reasons for this is that it takes a lot of time to reset a parser. Currently,
Xerces' internal infrastructure is designed so that the reset method to components inside
a parser would trigger a large number of XMLComponentManager.getProperty/getFeature.
This uses a string as a key, and the implementation of this method typically does a large
number of comparisons. This is slow, and this is redundant because almost all the time the
caller knows exactly what it wants.
Many of that work can be potentially replaced by a single field access of the form
xmlComponentManager.errorReporter
At least for the major components such as error-reporter.
Furthermore, in a sense, the idea of having each component to keep references to
other components individually is a bad idea when you think of performance. There only needs
to be one component that has references to all the other components, and everyone can ask
for that to obtain a reference.
Another design problem is that when a component manager doesn't know of a property/feature,
it throws an exception. The caller needs to always catch this exception. Throwing an exception
is a very costly operation, and setting up try-catch block is also not free.
I assume that this is a substantial change to XNI, so I understand if the JAXP team
is not willing to make this kind of changes, but I thought I should raise the issue
anyway.
###@###.### 2005-05-11 17:09:50 GMT