public void FullChildrenContainer_add_children_speed_test(BenchmarkContext context) { var name = (nameCounter += PrePopulatedActorCount).ToString(); _emptyContainer = _emptyContainer.Add(name, new ChildRestartStats(new PlaceHolderActorRef(name))); _childContainerOpsCounter.Increment(); }
public void FullChildrenContainer_remove_children_speed_test(BenchmarkContext context) { var name = nameCounter++.ToString(); _emptyContainer = _emptyContainer.Remove(new PlaceHolderActorRef(name)); _childContainerOpsCounter.Increment(); }
public void Setup(BenchmarkContext context) { _emptyContainer = EmptyChildrenContainer.Instance; _fullContainer = EmptyChildrenContainer.Instance; for (var i = 0; i < PrePopulatedActorCount; i++) { var name = i.ToString(); _fullContainer.Add(name, new ChildRestartStats(new PlaceHolderActorRef(name))); } _childContainerOpsCounter = context.GetCounter(ChildContainerOperationsName); nameCounter = 0; }
private bool SwapChildrenRefs(IChildrenContainer oldChildren, IChildrenContainer newChildren) { return(ReferenceEquals(Interlocked.CompareExchange(ref _childrenContainerDoNotCallMeDirectly, newChildren, oldChildren), oldChildren)); }