public void V6_RegistryBeforeOptimizations()
 {
     for (int i = 0; i < Calls; i++)
     {
         var handlers = registryBefore.GetHandlersFor(typeof(MessageHandlerRegistryBeforeOptimizations.MyMessage));
         foreach (var messageHandler in handlers)
         {
         }
     }
 }
        public MessageHandlerRegistryBeforeOptimizations V6_RegistryBeforeOptimizations()
        {
            var conventions = new MessageHandlerRegistryBeforeOptimizations.Conventions();

            conventions.AddSystemMessagesConventions(t => t == typeof(MessageHandlerRegistryBeforeOptimizations.MyMessage));

            var registry = new MessageHandlerRegistryBeforeOptimizations(conventions);

            registry.RegisterHandler(typeof(MessageHandlerRegistryBeforeOptimizations.Handler1));
            registry.RegisterHandler(typeof(MessageHandlerRegistryBeforeOptimizations.Handler2));
            registry.RegisterHandler(typeof(MessageHandlerRegistryBeforeOptimizations.Handler3));
            registry.RegisterHandler(typeof(MessageHandlerRegistryBeforeOptimizations.Handler4));
            registry.RegisterHandler(typeof(MessageHandlerRegistryBeforeOptimizations.Handler5));

            var handlers = registry.GetHandlersFor(typeof(MessageHandlerRegistryBeforeOptimizations.MyMessage));

            return(registry);
        }
        private static MessageHandlerRegistryBeforeOptimizations SetupRegistryBeforeOptimizations()
        {
            var conventions = new MessageHandlerRegistryBeforeOptimizations.Conventions();

            conventions.AddSystemMessagesConventions(t => t == typeof(MessageHandlerRegistryBeforeOptimizations.MyMessage));

            var registry = new MessageHandlerRegistryBeforeOptimizations(conventions);

            registry.RegisterHandler(typeof(MessageHandlerRegistryBeforeOptimizations.Handler1));
            registry.RegisterHandler(typeof(MessageHandlerRegistryBeforeOptimizations.Handler2));
            registry.RegisterHandler(typeof(MessageHandlerRegistryBeforeOptimizations.Handler3));
            registry.RegisterHandler(typeof(MessageHandlerRegistryBeforeOptimizations.Handler4));
            registry.RegisterHandler(typeof(MessageHandlerRegistryBeforeOptimizations.Handler5));

            var handlers = registry.GetHandlersFor(typeof(MessageHandlerRegistryBeforeOptimizations.MyMessage));

            foreach (var messageHandler in handlers)
            {
            }
            return(registry);
        }