Add a singleton NodeIdentifierWithPredicates 04/82604/20
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 20 Jun 2019 14:12:07 +0000 (16:12 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 27 Aug 2019 22:29:02 +0000 (00:29 +0200)
commit4d9034700f0ac327948c3be5ea347e628d82fd81
tree03afd916231b6f8a0de31f4c76af0450b75ed7af
parentb6ba37de8e39888262a2bfa21d804cd233990e89
Add a singleton NodeIdentifierWithPredicates

Heap dumps from OFP-centric load shows that single-predicate
identifiers are dominating the workload. This adds a dedicated
class to handle those cases.

The upshot of a dedicated class vs. a singleton map is a reduction
of one object, i.e. with SharedSingletonMap we get:

NodeIdentifierWithPredicates (24/32b)
SharedSingletonMap (24/32b)

whereas a dedicated class does only:

NodeIdentifierWithPredicates.Singleton (32/40b)

Which reduces total storage requirements from 48/64 bytes down to
32/40 bytes, saving 16/24 bytes (33/37.5%).

Change-Id: I3172ab9435d67adc12ae1734f9ad35f1dc8f891f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/NIPv1.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/YangInstanceIdentifier.java
yang/yang-data-api/src/test/java/org/opendaylight/yangtools/yang/data/api/YangInstanceIdentifierTest.java