BUG-7464: Optimize LNode operations 22/49922/11
authorRobert Varga <rovarga@cisco.com>
Mon, 2 Jan 2017 02:30:11 +0000 (03:30 +0100)
committerRobert Varga <rovarga@cisco.com>
Tue, 10 Jan 2017 19:12:11 +0000 (20:12 +0100)
commit0f68d6090d71ae30873e25f137c0e277ce1a2eb8
tree4b82e1a6e168a286e3867056d8c0a7e392371d46
parent5c8c004ae6d36b84d017853e686be93a82d75f9d
BUG-7464: Optimize LNode operations

Refactor ListMap into LNodeEntr{y,ies} and expose better
operations for node manipulation, since performance-critical
call sites already perform a prior lookup.

Therefore we can issue explicit insert/replace operations
insteads of generic 'add'. Insert operation becomes very fast,
as it does not need to perform any checking at all.

The replace operation does not require equivalence, as it
can use identity comparison on the entry, again improving
performance. Furthermore we can rely on the fact that
a particular entry is present exactly once, hence we can
stop iteration as soon as we find it.

Change-Id: I8c28e3521f1cbc298164b84b51dc300c3f3568a9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
third-party/triemap/src/main/java/org/opendaylight/yangtools/triemap/INode.java
third-party/triemap/src/main/java/org/opendaylight/yangtools/triemap/LNode.java
third-party/triemap/src/main/java/org/opendaylight/yangtools/triemap/LNodeEntries.java [new file with mode: 0644]
third-party/triemap/src/main/java/org/opendaylight/yangtools/triemap/LNodeEntry.java [new file with mode: 0644]
third-party/triemap/src/main/java/org/opendaylight/yangtools/triemap/ListMap.java [deleted file]
third-party/triemap/src/main/java/org/opendaylight/yangtools/triemap/TrieMap.java
third-party/triemap/src/test/java/org/opendaylight/yangtools/triemap/ListMapTest.java