Esempio n. 1
0
        public static BenchmarkResult RunAndCompare(BenchmarkRunConfiguration run,
                                                    BenchmarkRunConfiguration compareTo)
        {
            Asrt.True(File.Exists(compareTo.GetBenchmarkBaseFilename()),
                      "Benchmark recording file is missing! Please record a benchmark to compare to, before running a comparision.");

            var baseResults = BenchmarkRunResult.ReadFromFile(compareTo.GetBenchmarkBaseFilename());
            var results     = Run(run);

            return(new BenchmarkResult(results, baseResults));
        }
Esempio n. 2
0
        public BenchmarkResult(BenchmarkRunResult newResult, BenchmarkRunResult baseResult)
        {
            _newResult = newResult;
              _baseResult = baseResult;

              var baseDictionary = baseResult.Runs.ToDictionary(x => x.Name, x => x);

              foreach (var run in newResult.Runs)
              {
            var baseDuration = baseDictionary.ContainsKey(run.Name)
              ? baseDictionary[run.Name].Duration
              : run.Duration;

            _comparisions.Add(new BenchmarkRunResultComparision(run.Name, run.Duration, baseDuration));
              }
        }
Esempio n. 3
0
        public BenchmarkResult(BenchmarkRunResult newResult, BenchmarkRunResult baseResult)
        {
            _newResult  = newResult;
            _baseResult = baseResult;

            var baseDictionary = baseResult.Runs.ToDictionary(x => x.Name, x => x);

            foreach (var run in newResult.Runs)
            {
                var baseDuration = baseDictionary.ContainsKey(run.Name)
          ? baseDictionary[run.Name].Duration
          : run.Duration;


                _comparisions.Add(new BenchmarkRunResultComparision(run.Name, run.Duration, baseDuration));
            }
        }