The defer-node-expansion expands inner nodes on traversal, but its suitable for
bigger xmls (100k bytes) and messages that are not fully traversed. This is not
the case with incomming netconf rpc.
Source:
https://xerces.apache.org/xerces2-j/faq-performance.html
Tested:
Netconf server pipeline performance was improved by 5-6%
Change-Id: I3bd4b917841f0ebe212ff753d6e0f655d618968c
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
factory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
factory.setXIncludeAware(false);
factory.setExpandEntityReferences(false);
factory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
factory.setXIncludeAware(false);
factory.setExpandEntityReferences(false);
+ // Performance improvement for messages with size <10k according to
+ // https://xerces.apache.org/xerces2-j/faq-performance.html
+ factory.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", false);
} catch (ParserConfigurationException e) {
throw new ExceptionInInitializerError(e);
}
} catch (ParserConfigurationException e) {
throw new ExceptionInInitializerError(e);
}