Improve InjectionKey performance 43/7643/1
authorRobert Varga <robert.varga@pantheon.sk>
Tue, 3 Jun 2014 12:12:01 +0000 (14:12 +0200)
committerRobert Varga <robert.varga@pantheon.sk>
Tue, 3 Jun 2014 13:54:55 +0000 (15:54 +0200)
commit87fdc8efcfbce4d56da5377e7448e0857f492392
tree2010b6126a3fde379fc8944546ad80f7cfc26513
parente82ecc6bb4235e792b21964019ea07fc62e9ad3c
Improve InjectionKey performance

As it turns out we put these into a HashMap, so not dispersing on class
name is actively hurting us. The trade-off here is between hashCode()
performance and its effectiveness.

The design of this class called for Strings to be used as identifiers,
and hashCode() of strings is generally slow. As it turns out, though,
all the strings used were derived from classes -- which is good news.

This patch switches to using Class<?> objects as identifiers, as they
have fast hashCode/equals and the lookups are equivalent.

Change-Id: I51e572dc98088733eca15c35ee6d0bac991c5da7
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/action/ActionSetNwDstReactor.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/action/ActionSetNwDstReactorMappingFactory.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/action/ActionSetNwSrcReactor.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/action/ActionSetNwSrcReactorMappingFactory.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/common/ConvertReactor.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/common/InjectionKey.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/common/InjectionResultTargetKey.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/flowflag/FlowFlagReactorMappingFactory.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/match/MatchReactorMappingFactory.java