public void MeasureStaticSubscriptionsPerformance()
        {
            var peers = Enumerable.Range(0, 100).Select(x => new Peer(new PeerId("Abc.Testing" + x), "tcp://testing:" + x)).ToList();
            Console.WriteLine("{0} peers", peers.Count);
            Console.WriteLine();

            var subscriptionList = new PeerSubscriptionList();
            var subscriptionTree = new PeerSubscriptionTree();

            foreach (var peer in peers)
            {
                subscriptionList.Add(peer, Subscription.Any<FakeEvent>());
                subscriptionTree.Add(peer, BindingKey.Empty);
            }

            Console.WriteLine("{0} test -------------", subscriptionList.GetType().Name);
            Console.WriteLine();
            Measure.Execution(x =>
            {
                x.Iteration = 100000;
                x.WarmUpIteration = 1000;
                x.Action = _ => subscriptionList.GetPeers(BindingKey.Empty);
            });
            Console.WriteLine();

            Console.WriteLine("{0} test -------------", subscriptionTree.GetType().Name);
            Console.WriteLine();
            Measure.Execution(x =>
            {
                x.Iteration = 100000;
                x.WarmUpIteration = 1000;
                x.Action = _ => subscriptionTree.GetPeers(BindingKey.Empty);
            });
        }
        public void MeasureDynamicSubscriptionsPerformance(string routingKey)
        {
            var subscriptions = GenerateSubscriptions().ToList();
            Console.WriteLine("{0} subscriptions", subscriptions.Count);
            Console.WriteLine();

            var subscriptionList = new PeerSubscriptionList();
            var subscriptionTree = new PeerSubscriptionTree();
            foreach (var peerSubscription in subscriptions)
            {
                subscriptionList.Add(peerSubscription.Item1, peerSubscription.Item2);
                subscriptionTree.Add(peerSubscription.Item1, peerSubscription.Item2.BindingKey);
            }

            var bindingKey = BindingKey.Split(routingKey);

            Console.WriteLine("{0} test -------------", subscriptionList.GetType().Name);
            Console.WriteLine();
            Measure.Execution(x =>
            {
                x.Iteration = 10000;
                x.WarmUpIteration = 1000;
                x.Action = _ => subscriptionList.GetPeers(bindingKey);
            });
            Console.WriteLine();

            Console.WriteLine("{0} test -------------", subscriptionTree.GetType().Name);
            Console.WriteLine();
            Measure.Execution(x =>
            {
                x.Iteration = 10000;
                x.WarmUpIteration = 1000;
                x.Action = _ => subscriptionTree.GetPeers(bindingKey);
            });
        }