|
|
|
@ -8,8 +8,8 @@ namespace Performance |
|
|
|
{ |
|
|
|
public static void Main() |
|
|
|
{ |
|
|
|
Run(new LinearAlgebra.DenseVectorAdd(10000000), 10, "Large"); |
|
|
|
Run(new LinearAlgebra.DenseVectorAdd(100), 10000, "Small"); |
|
|
|
Run(new LinearAlgebra.DenseVectorAdd(10000000), 10, "Large (10'000'000)"); |
|
|
|
Run(new LinearAlgebra.DenseVectorAdd(100), 10000, "Small (100)"); |
|
|
|
} |
|
|
|
|
|
|
|
static void Run<T>(uint iterations, string suffix = null) where T:new() |
|
|
|
@ -17,7 +17,7 @@ namespace Performance |
|
|
|
var bench = new BenchShark(); |
|
|
|
var result = bench.EvaluateDecoratedTasks<T>(iterations); |
|
|
|
var label = string.IsNullOrEmpty(suffix) ? typeof (T).FullName : string.Concat(typeof (T).FullName, ": ", suffix); |
|
|
|
result.FastestEvaluations.Select(x => new { x.Name, x.BestExecutionTime, x.AverageExecutionTime, x.WorstExecutionTime, x.TotalExecutionTime }).Dump(label); |
|
|
|
result.FastestEvaluations.Select(x => new { x.Name, x.BestExecutionTime, x.AverageExecutionTime, x.WorstExecutionTime }).Dump(label); |
|
|
|
} |
|
|
|
|
|
|
|
static void Run(object obj, uint iterations, string suffix = null) |
|
|
|
@ -25,7 +25,7 @@ namespace Performance |
|
|
|
var bench = new BenchShark(); |
|
|
|
var result = bench.EvaluateDecoratedTasks(obj, iterations); |
|
|
|
var label = string.IsNullOrEmpty(suffix) ? obj.GetType().FullName : string.Concat(obj.GetType().FullName, ": ", suffix); |
|
|
|
result.FastestEvaluations.Select(x => new { x.Name, x.BestExecutionTime, x.AverageExecutionTime, x.WorstExecutionTime, x.TotalExecutionTime }).Dump(label); |
|
|
|
result.FastestEvaluations.Select(x => new { x.Name, x.BestExecutionTime, x.AverageExecutionTime, x.WorstExecutionTime }).Dump(label); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|