Example #1
0
        /// <summary>Executes the batch operation.</summary>
        /// <param name="configRun">The configuration run.</param>
		private static void RunBatch(OrmLiteConfigRun configRun)
		{
			Console.Write(";");
			var useCases = GetUseCases();

			useCases.ForEach(uc => Console.Write("{0};", uc.GetType().Name));
			Console.WriteLine();
			BatchIterations.ForEach(iterations => {
				Console.Write("{0};", iterations);
				useCases.ForEach(uc => {

					configRun.Init(uc);

					// warmup
					uc.Run();
					GC.Collect();
					Console.Write("{0};", Measure(uc.Run, iterations));
				});
				Console.WriteLine();
			});
		}
Example #2
0
        /// <summary>Executes the interactive operation.</summary>
        /// <param name="configRun">The configuration run.</param>
        /// <param name="args">     The arguments.</param>
		private static void RunInteractive(OrmLiteConfigRun configRun, string[] args)
		{
			long iterations = DefaultIterations;

			if (args.Length != 0)
				iterations = long.Parse(args[0]);

			Console.WriteLine("Running {0} iterations for each use case.", iterations);

			var useCases = GetUseCases();
			useCases.ForEach(uc => {

				configRun.Init(uc);

				// warmup
				uc.Run();
				GC.Collect();
               	
				var avgMs = Measure(uc.Run, iterations);
				Console.WriteLine("{0}: Avg: {1}ms", uc.GetType().Name, avgMs);
			});
		}