public void TestsFileSystemDataFeedSpeed()
        {
            var job                = new BacktestNodePacket();
            var resultHandler      = new BacktestingResultHandler();
            var mapFileProvider    = new LocalDiskMapFileProvider();
            var factorFileProvider = new LocalDiskFactorFileProvider(mapFileProvider);
            var dataProvider       = new DefaultDataProvider();

            var algorithm   = PerformanceBenchmarkAlgorithms.SingleSecurity_Second;
            var feed        = new FileSystemDataFeed();
            var dataManager = new DataManager(feed, new UniverseSelection(feed, algorithm), algorithm.Settings, algorithm.TimeKeeper);

            algorithm.SubscriptionManager.SetDataManager(dataManager);

            feed.Initialize(algorithm, job, resultHandler, mapFileProvider, factorFileProvider, dataProvider, dataManager);
            algorithm.Initialize();
            algorithm.PostInitialize();

            var feedThreadStarted = new ManualResetEvent(false);
            var dataFeedThread    = new Thread(() =>
            {
                feedThreadStarted.Set();
                feed.Run();
            })
            {
                IsBackground = true
            };

            dataFeedThread.Start();
            feedThreadStarted.WaitOne();

            var count     = 0;
            var stopwatch = Stopwatch.StartNew();
            var lastMonth = algorithm.StartDate.Month;

            foreach (var timeSlice in feed)
            {
                if (timeSlice.Time.Month != lastMonth)
                {
                    var elapsed   = stopwatch.Elapsed.TotalSeconds;
                    var thousands = count / 1000d;
                    Console.WriteLine($"{DateTime.Now} - Time: {timeSlice.Time}: KPS: {thousands/elapsed}");
                    lastMonth = timeSlice.Time.Month;
                }
                count++;
            }
            Console.WriteLine("Count: " + count);

            stopwatch.Stop();
            Console.WriteLine($"Elapsed time: {stopwatch.Elapsed}   KPS: {count/1000d/stopwatch.Elapsed.TotalSeconds}");
        }
        public void TestsFileSystemDataFeedSpeed()
        {
            var job                = new BacktestNodePacket();
            var resultHandler      = new BacktestingResultHandler();
            var mapFileProvider    = new LocalDiskMapFileProvider();
            var factorFileProvider = new LocalDiskFactorFileProvider(mapFileProvider);
            var dataProvider       = new DefaultDataProvider();

            var algorithm = new BenchmarkTest();
            var feed      = new FileSystemDataFeed();

            feed.Initialize(algorithm, job, resultHandler, mapFileProvider, factorFileProvider, dataProvider);
            algorithm.Initialize();

            var feedThreadStarted = new ManualResetEvent(false);

            Task.Factory.StartNew(() =>
            {
                feedThreadStarted.Set();
                feed.Run();
            });
            feedThreadStarted.WaitOne();

            var stopwatch = Stopwatch.StartNew();
            var lastMonth = -1;
            var count     = 0;

            foreach (var timeSlice in feed)
            {
                if (timeSlice.Time.Month != lastMonth)
                {
                    Console.WriteLine(DateTime.Now + " - Time: " + timeSlice.Time);
                    lastMonth = timeSlice.Time.Month;
                }
                count++;
            }
            Console.WriteLine("Count: " + count);

            stopwatch.Stop();
            Console.WriteLine("Elapsed time: " + stopwatch.Elapsed);
        }