Optimize ResolveDataChangeEventsTask object allocation 20/16820/1
authorRobert Varga <rovarga@cisco.com>
Thu, 19 Mar 2015 11:58:48 +0000 (12:58 +0100)
committerRobert Varga <rovarga@cisco.com>
Thu, 19 Mar 2015 11:58:48 +0000 (12:58 +0100)
commit26a633e9cc7382bb90fbfbd07e5ad9443f8ca0dd
tree93655eff86b5cd373ffa97e3fde807fbee683661
parent576efc4bd225c62269108466aaaa2c4a2dfd4d65
Optimize ResolveDataChangeEventsTask object allocation

ResolveDataChangeEventsTask queried before/afterData methods multiple
times. The default implementation in yangtools instantiates an object on
each call, which leads to sub-optimal performance. Cache the returned
object and use it locally, which actually makes the code more readable.

As a further change, perform the same caching with modification type, as
that may end up being computed on access.

Change-Id: I43aa4824c1a5788060035cd419400d86b0116de7
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/sal-inmemory-datastore/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/ResolveDataChangeEventsTask.java