=cdd #18328 use set operators union diff instead of ++ --
AFTER: [info] Benchmark (set1Size) Mode Cnt Score Error Units [info] ORSetMergeBenchmark.mergeAddFromBothNodes 1 thrpt 10 1892.687 ± 182.830 ops/ms [info] ORSetMergeBenchmark.mergeAddFromBothNodes 10 thrpt 10 346.653 ± 22.048 ops/ms [info] ORSetMergeBenchmark.mergeAddFromBothNodes 20 thrpt 10 215.354 ± 15.486 ops/ms [info] ORSetMergeBenchmark.mergeAddFromBothNodes 100 thrpt 10 46.544 ± 2.930 ops/ms [info] ORSetMergeBenchmark.mergeAddFromOtherNode 1 thrpt 10 2483.531 ± 192.286 ops/ms [info] ORSetMergeBenchmark.mergeAddFromOtherNode 10 thrpt 10 355.292 ± 27.886 ops/ms [info] ORSetMergeBenchmark.mergeAddFromOtherNode 20 thrpt 10 211.221 ± 14.300 ops/ms [info] ORSetMergeBenchmark.mergeAddFromOtherNode 100 thrpt 10 47.516 ± 2.750 ops/ms [info] ORSetMergeBenchmark.mergeAddFromSameNode 1 thrpt 10 10323.210 ± 732.747 ops/ms [info] ORSetMergeBenchmark.mergeAddFromSameNode 10 thrpt 10 3476.660 ± 512.333 ops/ms [info] ORSetMergeBenchmark.mergeAddFromSameNode 20 thrpt 10 3490.045 ± 180.549 ops/ms [info] ORSetMergeBenchmark.mergeAddFromSameNode 100 thrpt 10 2915.627 ± 202.994 ops/ms [info] ORSetMergeBenchmark.mergeComplex 1 thrpt 10 556.034 ± 44.991 ops/ms [info] ORSetMergeBenchmark.mergeComplex 10 thrpt 10 246.468 ± 14.414 ops/ms [info] ORSetMergeBenchmark.mergeComplex 20 thrpt 10 175.547 ± 12.543 ops/ms [info] ORSetMergeBenchmark.mergeComplex 100 thrpt 10 47.452 ± 1.467 ops/ms BEFORE: [info] Benchmark (set1Size) Mode Cnt Score Error Units [info] ORSetMergeBenchmark.mergeAddFromBothNodes 1 thrpt 10 2007.939 ± 74.673 ops/ms [info] ORSetMergeBenchmark.mergeAddFromBothNodes 10 thrpt 10 337.110 ± 15.055 ops/ms [info] ORSetMergeBenchmark.mergeAddFromBothNodes 20 thrpt 10 223.600 ± 8.403 ops/ms [info] ORSetMergeBenchmark.mergeAddFromBothNodes 100 thrpt 10 46.697 ± 2.136 ops/ms [info] ORSetMergeBenchmark.mergeAddFromOtherNode 1 thrpt 10 2542.537 ± 120.697 ops/ms [info] ORSetMergeBenchmark.mergeAddFromOtherNode 10 thrpt 10 365.694 ± 17.571 ops/ms [info] ORSetMergeBenchmark.mergeAddFromOtherNode 20 thrpt 10 216.323 ± 9.446 ops/ms [info] ORSetMergeBenchmark.mergeAddFromOtherNode 100 thrpt 10 49.563 ± 2.725 ops/ms [info] ORSetMergeBenchmark.mergeAddFromSameNode 1 thrpt 10 9883.186 ± 725.672 ops/ms [info] ORSetMergeBenchmark.mergeAddFromSameNode 10 thrpt 10 3266.528 ± 189.993 ops/ms [info] ORSetMergeBenchmark.mergeAddFromSameNode 20 thrpt 10 3206.017 ± 124.623 ops/ms [info] ORSetMergeBenchmark.mergeAddFromSameNode 100 thrpt 10 2709.031 ± 162.182 ops/ms [info] ORSetMergeBenchmark.mergeComplex 1 thrpt 10 572.704 ± 21.504 ops/ms [info] ORSetMergeBenchmark.mergeComplex 10 thrpt 10 249.226 ± 12.324 ops/ms [info] ORSetMergeBenchmark.mergeComplex 20 thrpt 10 170.560 ± 10.320 ops/ms [info] ORSetMergeBenchmark.mergeComplex 100 thrpt 10 46.373 ± 1.800 ops/ms
This commit is contained in:
parent
c11b600cc1
commit
3c5936aaa1
4 changed files with 4 additions and 6 deletions
|
|
@ -60,7 +60,7 @@ final case class GSet[A](elements: Set[A]) extends ReplicatedData with Replicate
|
|||
else if (this.isAncestorOf(that)) that.clearAncestor()
|
||||
else {
|
||||
clearAncestor()
|
||||
copy(elements ++ that.elements)
|
||||
copy(elements union that.elements)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@ import akka.cluster.Cluster
|
|||
import akka.cluster.UniqueAddress
|
||||
import akka.util.HashCode
|
||||
|
||||
// TODO this class can be optimized, but I wanted to start with correct functionality and comparability with riak_dt_orswot
|
||||
|
||||
object ORSet {
|
||||
private val _empty: ORSet[Any] = new ORSet(Map.empty, VersionVector.empty)
|
||||
def empty[A]: ORSet[A] = _empty.asInstanceOf[ORSet[A]]
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ private[akka] final case class PruningState(owner: UniqueAddress, phase: Pruning
|
|||
case (_, PruningPerformed) ⇒ that
|
||||
case (PruningInitialized(thisSeen), PruningInitialized(thatSeen)) ⇒
|
||||
if (this.owner == that.owner)
|
||||
copy(phase = PruningInitialized(thisSeen ++ thatSeen))
|
||||
copy(phase = PruningInitialized(thisSeen union thatSeen))
|
||||
else if (Member.addressOrdering.compare(this.owner.address, that.owner.address) > 0)
|
||||
that
|
||||
else
|
||||
|
|
|
|||
|
|
@ -1045,7 +1045,7 @@ final class Replicator(settings: ReplicatorSettings) extends Actor with ActorLog
|
|||
val myKeys =
|
||||
if (totChunks == 1) dataEntries.keySet
|
||||
else dataEntries.keysIterator.filter(_.hashCode % totChunks == chunk).toSet
|
||||
val otherMissingKeys = myKeys -- otherKeys
|
||||
val otherMissingKeys = myKeys diff otherKeys
|
||||
val keys = (otherDifferentKeys ++ otherMissingKeys).take(maxDeltaElements)
|
||||
if (keys.nonEmpty) {
|
||||
if (log.isDebugEnabled)
|
||||
|
|
@ -1053,7 +1053,7 @@ final class Replicator(settings: ReplicatorSettings) extends Actor with ActorLog
|
|||
val g = Gossip(keys.map(k ⇒ k -> getData(k).get)(collection.breakOut), sendBack = otherDifferentKeys.nonEmpty)
|
||||
sender() ! g
|
||||
}
|
||||
val myMissingKeys = otherKeys -- myKeys
|
||||
val myMissingKeys = otherKeys diff myKeys
|
||||
if (myMissingKeys.nonEmpty) {
|
||||
if (log.isDebugEnabled)
|
||||
log.debug("Sending gossip status to [{}], requesting missing [{}]", sender().path.address, myMissingKeys.mkString(", "))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue