Use ImmutableMaps for lazy augmentations initialization
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 14 Nov 2018 15:40:29 +0000 (16:40 +0100)
committerAnil Belur <abelur@linuxfoundation.org>
Wed, 19 Jun 2024 00:41:25 +0000 (10:41 +1000)
commit78864ed636a0ce4dbd796b7055837a5fd21779a9
treee71987ad0f1f4ad246e697b2c26b2a037ba712bb
parentd7ff09e9a9dc07977ea457ec9d8fd023d9fbb01d
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