Performacne: Control string interning of
OMStAXWrapper.getNamespaceURI()...Default should be no
-----------------------------------------------------------------------------------------------
Key: WSCOMMONS-280
URL: https://issues.apache.org/jira/browse/WSCOMMONS-280
Project: WS-Commons
Issue Type: Bug
Components: AXIOM
Reporter: Rich Scheuerle
Assignee: Rich Scheuerle
Problem:
A recent change was made to OMStAXWrapper.getNamespaceURI() to always intern
the returned namespace uri string. This cause an unnecessary lock on the
String pool, which degrades
performance. This change was added due to address the following issue:
http://thread.gmane.org/gmane.text.xml.security.devel/5825. The solution
below provides a way for the user to request
interning.
More Information:
Most XMLStreamReader parsers have a flag to toggle String interning. For
performance reasons, many of these parsers default to no interning.
Thus the OMStAXWrapper should also default to no interning.
The OMStAXWrapper is a wrapper around a parser or OM tree.
If the underlying parser has already interned the namespace, there is no reason
to repeat the interning.
The problem is that there is no standard parser property to detect string
interning. (Woodstox has a property on the XMLInputFactory. IBM's parser has
a property on the XMLStreamReader).
Solution:
I added isNamespaceURIInterning and setNamespaceURIInterning methods to
OMStAXWrapper. This gives the user the control. The default is reverted back
to no interning.
Future:
This is a tactical solution.
We might need to revisit this code if StAX provides public properties to
control the interning of namespace uris and strings.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]