Speed up BindingReflections.getAugmentations() 28/81728/2
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 24 Apr 2019 09:05:38 +0000 (11:05 +0200)
committerRobert Varga <nite@hq.sk>
Wed, 24 Apr 2019 12:48:43 +0000 (12:48 +0000)
commitefb454b9e1e6869240aebd6489e6219abefec227
tree6fcf8226c2745b958312c4d09ec9720ec8200f44
parent0de2fd0fa7ad26db607e9703bcc8296bed9073a5
Speed up BindingReflections.getAugmentations()

One of the ways in which we can acquire augmentations is through
AugmentationHolder interface. While this is handled through
AugmentationFieldGetter.getGetter(), that is not really efficient
as it requires indirection through multiple implementations.

Since AugmentationFieldGetter is a package-internal implementation
detail, factor the check out into BindingReflections, where it can
execute directly. This not only improves locality, but also allows
us to remove one AugmentationFieldGetter implementation, resulting
in bimorphic invocation.

Change-Id: I15584dbe6151a70d13a766f27b927f598a5d21ba
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-spec-util/src/main/java/org/opendaylight/mdsal/binding/spec/reflect/AugmentationFieldGetter.java
binding/mdsal-binding-spec-util/src/main/java/org/opendaylight/mdsal/binding/spec/reflect/BindingReflections.java
binding/mdsal-binding-spec-util/src/test/java/org/opendaylight/mdsal/binding/spec/reflect/AugmentationFieldGetterTest.java