From daf290592a379b5c05a0f5ee9c981c7f83103bbe Mon Sep 17 00:00:00 2001 From: Marko Lahma Date: Sun, 14 Oct 2018 14:56:05 +0300 Subject: [PATCH] change benchmarks to run both full framework and core --- .gitignore | 2 +- test/Spring/Spring.Benchmark/App.config | 25 ------------------- .../Spring.Benchmark/ContainerBenchmark.cs | 7 +++--- .../Spring.Benchmark/ContainerBenchmark.xml | 14 +++++++++++ .../Spring.Benchmark/HybridSetBenchmark.cs | 2 +- .../Spring.Benchmark/Spring.Benchmark.csproj | 8 +++++- 6 files changed, 27 insertions(+), 31 deletions(-) delete mode 100644 test/Spring/Spring.Benchmark/App.config create mode 100644 test/Spring/Spring.Benchmark/ContainerBenchmark.xml diff --git a/.gitignore b/.gitignore index 78ce6dd1..2829e9c8 100644 --- a/.gitignore +++ b/.gitignore @@ -87,4 +87,4 @@ PrecompiledWeb project.lock.json -BenchmarkDotNet.Artifacts +BenchmarkDotNet.Artifacts* diff --git a/test/Spring/Spring.Benchmark/App.config b/test/Spring/Spring.Benchmark/App.config deleted file mode 100644 index 402699ae..00000000 --- a/test/Spring/Spring.Benchmark/App.config +++ /dev/null @@ -1,25 +0,0 @@ - - - - -
-
- - -
- - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/test/Spring/Spring.Benchmark/ContainerBenchmark.cs b/test/Spring/Spring.Benchmark/ContainerBenchmark.cs index ea432603..b2525220 100644 --- a/test/Spring/Spring.Benchmark/ContainerBenchmark.cs +++ b/test/Spring/Spring.Benchmark/ContainerBenchmark.cs @@ -25,11 +25,11 @@ using Spring.Context.Support; namespace Spring.Benchmark { - [MediumRunJob] + [ClrJob, CoreJob] [MemoryDiagnoser] public class ContainerBenchmark { - private IApplicationContext container; + private XmlApplicationContext container; [Params(5_000)] public int Iterations { get; set; } @@ -37,7 +37,8 @@ namespace Spring.Benchmark [GlobalSetup] public void GlobalSetup() { - container = ContextRegistry.GetContext(); + container = new XmlApplicationContext("ContainerBenchmark.xml"); + container.Refresh(); } [Benchmark] diff --git a/test/Spring/Spring.Benchmark/ContainerBenchmark.xml b/test/Spring/Spring.Benchmark/ContainerBenchmark.xml new file mode 100644 index 00000000..53c4cb39 --- /dev/null +++ b/test/Spring/Spring.Benchmark/ContainerBenchmark.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/test/Spring/Spring.Benchmark/HybridSetBenchmark.cs b/test/Spring/Spring.Benchmark/HybridSetBenchmark.cs index b101d49f..81cc39d5 100644 --- a/test/Spring/Spring.Benchmark/HybridSetBenchmark.cs +++ b/test/Spring/Spring.Benchmark/HybridSetBenchmark.cs @@ -23,7 +23,7 @@ using Spring.Objects.Factory.Support; namespace Spring.Benchmark { - [MediumRunJob] + [ClrJob, CoreJob] [MemoryDiagnoser] public class HybridSetBenchmark { diff --git a/test/Spring/Spring.Benchmark/Spring.Benchmark.csproj b/test/Spring/Spring.Benchmark/Spring.Benchmark.csproj index 38dc4add..d394036b 100644 --- a/test/Spring/Spring.Benchmark/Spring.Benchmark.csproj +++ b/test/Spring/Spring.Benchmark/Spring.Benchmark.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.1 + net471;netcoreapp2.1 Spring.Benchmark @@ -14,4 +14,10 @@ + + + PreserveNewest + + +