Do not format QNames to string on input 16/82316/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 28 May 2019 11:14:34 +0000 (13:14 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 29 May 2019 18:00:42 +0000 (20:00 +0200)
commit29ceb5385e45275a8125b73b1a2e5b9d0e369c02
tree1ba1452a2ded357a7a686fb490807807dbd23d4f
parent5a0b7e550a7a484cee4693b63df0849111a8236a
Do not format QNames to string on input

Profiling has revelead the creation of String for QNameFactory
lookup is taking around 19% of overall cost of
NormalizedNodeInputStreamReader.readQName().

Rather than using concatenation, use a dedicated Key object, which
holds the separated-out localname/namespace/revision strings,
thus allocating a small object instead of a full-blown String.

This improves snapshot deserialization perfomance on a 350MiB
snapshot by about 16%, also resulting in lower memory pressure.

JIRA: CONTROLLER-1897
Change-Id: If3e9e4b332b0a5acbe33aa10fca189bbc7da8c81
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit a69604185f71923bdfc16d2d056490fff9a8d90e)
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/QNameFactory.java
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeInputStreamReader.java
opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/QNameFactoryTest.java