예제 #1
0
        public static void InitializeAllTests(TestContext context)
        {
            // install db directly
            var dbProvider = new EF6SecurityDataProvider();

            dbProvider.InstallDatabase();

            var x = PermissionType.See; // preloads the type
        }
예제 #2
0
        //[TestMethod Timeout(10*60*1000)]
        public void EF_Performance_SystemStart_BigEntityTable()
        {
            Stopwatch timer;
            IDictionary <int, SecurityEntity> entities;

            var dataProvider = new EF6SecurityDataProvider(connectionString: ConnectionString);

            timer = Stopwatch.StartNew();
            var data = dataProvider.LoadSecurityEntities();

            timer.Stop();
            var time1 = timer.Elapsed;

            Debug.WriteLine("warmup: " + time1);


            //timer = Stopwatch.StartNew();
            ////var entities = DataHandler.LoadSecurityEntities(dataProvider);
            //entities = LoadSecurityEntities_1(dataProvider);
            //timer.Stop();
            //var time2 = timer.Elapsed;
            //Debug.WriteLine("loading time#1: " + time2);


            //timer = Stopwatch.StartNew();
            //entities = LoadSecurityEntities_2(dataProvider);
            //timer.Stop();
            //var time3 = timer.Elapsed;
            //Debug.WriteLine("loading time#2: " + time3);

            _log.Clear();
            timer    = Stopwatch.StartNew();
            entities = LoadSecurityEntities_3(dataProvider);
            timer.Stop();
            var time4 = timer.Elapsed;

            Debug.WriteLine("loading time#2: " + time4);


            //Assert.Inconclusive("Loading times: {0}, {1}, {2}, {3}, {4}", time1, time2, time3, time4, _log);
            Assert.Inconclusive("Loading times: {0}, {1}, {2}", time1, time4, _log);


            // Loading times: 00:00:10.2905993, 00:02:35.7031781, 00:02:11.6167352 // #1: main lists with explicite capacity
            // Loading times: 00:00:10.2637016, 00:02:33.3550854, 00:02:07.6887293 // #2: dictionary instead of concurrent dictionary
            //                                                                            + less dictionary lookups in the building relationships
            // Loading times: 00:00:10.2887780, 00:02:33.5082941, 00:02:03.8172389
            // Load: 00:00:12.9822886, Rel: 00:01:46.5209197, Copy: 00:00:04.6075951
            // Load: 00:00:13.0581931, Rel: 00:01:46.7875856, Copy: 00:00:07.4265863
            // Load: 00:00:13.2952581, Rel: 00:01:46.8437112, Copy: 00:00:03.3409542
            // Load: 00:00:12.9505824, Rel: 00:00:02.8798472, Copy: 00:00:03.6220331 // #3: AddChild_Unsafe
            // Loading times: 00:00:09.5691147, 00:00:19.1797264, Load: 00:00:12.7218657, Rel: 00:00:02.9009923, Copy: 00:00:03.5535364
        }