Use ImmutableMaps for lazy augmentations initialization 99/77799/5
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 14 Nov 2018 15:40:29 +0000 (16:40 +0100)
committerTom Pantelis <tompantelis@gmail.com>
Sat, 17 Nov 2018 02:44:40 +0000 (02:44 +0000)
commitd349008b4936f7e128ec292a66e05f3e9bd57e73
treecead3184a950b2d725e7dee3d3cf4d06ee4530dd
parenteed478044b1ec55aa58f973fd1214e084129a610
Use ImmutableMaps for lazy augmentations initialization

Rather than tracking lookups in two separate ConcurrentMaps, we
perform locked atomic updates in copy-on-write immutable structure.

The two lookup maps are kept in ImmutableMaps, which offer tighter
packing and do not incur any further volatile reads beyond getting
a reference to them.

This results in lower memory overhead, as the maps are more tightly
packed and also biases performance towards the dominant use case,
which is pure lookups.

JIRA: MDSAL-391
Change-Id: I65ecb25a5d364040be44df144000d1bbbc2a922e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/impl/DataObjectCodecContext.java