Simple hashmap on Elem -> Elem, makes no optimisations across qnames (use QNameOptimisationT for that)
An elem with attributes or namespaces and only one text value.
Memory usage in DOMs is often dominated by repeated elements.
An elem with no attributes, namespaces and only one text value.
Simple marker for per parse optimisation oppurtunties
Certain paths may be repeated (based on QNames of parents etc) and known to be by the developer, its also possible that the developer simply is not interested in this path.
Certain paths may be repeated (based on QNames of parents etc) and known to be by the developer, its also possible that the developer simply is not interested in this path.
Developers may also customise the creation of paths, for example adding starting children, replacing the XmlChildren implementation or replacing entire subtrees.
Threadsafe global cache, assumption is most applications would benefit from this
As this adds extra processing time, but better fits XPath rules (i.e.
As this adds extra processing time, but better fits XPath rules (i.e. all text children below are joined) its available to be mixed in, but isn't added by default.
This also removes any extra parsing time from string joining.
Allows replacing a tree for memory optimisations
Optimises on QNames and Elems, reducing duplicates at the cost of CHM lookups.
Collection of optimisations that reduce memory significantly at the cost of parsing performance, and later non-lazy creation of correct objects for accessing the tree.
Collection of optimisations that reduce memory significantly at the cost of parsing performance, and later non-lazy creation of correct objects for accessing the tree.
This can have confusing runtime evaluation of XPaths etc. These optimisations are appropriate for trees that are seldom read, repeated reads may generate too much garbage.
Performs no optimisation at all
Optimised QNames, Elems and Tree, heavily reduced memory consumption with LazyOptimisedTree.
The default as it will equal or better Scala Xml memory consumption at a performance gain.
The default as it will equal or better Scala Xml memory consumption at a performance gain.
For the lowest memory consumption possible, for example where memory is more important than raw performance, see QNameElemTreeOptimisation
scales.xml.strategies.QNameElemTreeOptimisation
Optimises QNames and Trees according to LazyOptimisedTree
Memory usage in DOMs is often dominated by repeated elements. Xerces and co use string tables to optimise memory usage, with DTM a key example.
Performing lookups is expensive so the strategies can have selective levels of lookup. Developers may therefore choose appropriate levels that best fit their trade-off between space and time.
There will, of course, be temporary garbage created for such a scheme but it should pay off for larger messages.