Performance optimizations for simple transactions 55/15955/3
authorMoiz Raja <moraja@cisco.com>
Tue, 3 Mar 2015 00:32:31 +0000 (16:32 -0800)
committerMoiz Raja <moraja@cisco.com>
Mon, 9 Mar 2015 16:11:10 +0000 (09:11 -0700)
commit76601bed132933632ab6d397e71cc2aa533bf82f
tree2efad48f43b96f82f9125289ba0de68bcf743a25
parent32e32254cf269027359a786735f0b7fb580b39a4
Performance optimizations for simple transactions

- Cache the ActorSelection for the primary shard in ActorContext
- Use isInstance to check for type of message instead of equals in ActorContext
  ShardManager and Shard
- Change the order in which we check for transaction type to create in Shard
- Create ShardTransactionIdentifier using the ShardTransactionIdentifier
  constructor instead of the Builder

These optimizations are aimed at making simple transactions faster in the dsBenchMark. This
set of optimizations reduced the amount of time that test takes from 20s to 18s on my Mac.

Change-Id: I1a4328d90839ef80041ae4f3bb7dccd45ac7fb97
Signed-off-by: Moiz Raja <moraja@cisco.com>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardManager.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/identifiers/ShardTransactionIdentifier.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/ActorContext.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/ActorContextTest.java