diff --git a/Directory.Build.props b/Directory.Build.props index 15847a1..56d3746 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -24,6 +24,10 @@ true + + net7.0;net8.0;net9.0 + + 12.0 enable diff --git a/Directory.Packages.props b/Directory.Packages.props index b41664f..2583b13 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -15,17 +15,17 @@ - - + + - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -35,15 +35,15 @@ - + all runtime; build; native; contentfiles; analyzers - + all runtime; build; native; contentfiles; analyzers - + all runtime; build; native; contentfiles; analyzers diff --git a/global.json b/global.json index 48e1c84..7d5f369 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "8.0.100" + "version": "9.0.100-rc.1.24452.12" } } diff --git a/perf/MyCSharp.HttpUserAgentParser.Benchmarks/HttpUserAgentParserBenchmarks.cs b/perf/MyCSharp.HttpUserAgentParser.Benchmarks/HttpUserAgentParserBenchmarks.cs index db187cc..06546d2 100644 --- a/perf/MyCSharp.HttpUserAgentParser.Benchmarks/HttpUserAgentParserBenchmarks.cs +++ b/perf/MyCSharp.HttpUserAgentParser.Benchmarks/HttpUserAgentParserBenchmarks.cs @@ -1,49 +1,49 @@ // Copyright © myCSharp.de - all rights reserved -using System.Collections.Generic; -using System.Linq; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; #if OS_WIN using BenchmarkDotNet.Diagnostics.Windows.Configs; #endif -namespace MyCSharp.HttpUserAgentParser.Benchmarks -{ - [MemoryDiagnoser] +namespace MyCSharp.HttpUserAgentParser.Benchmarks; + +[MemoryDiagnoser] +[SimpleJob(RuntimeMoniker.Net80)] +[SimpleJob(RuntimeMoniker.Net90)] #if OS_WIN - [EtwProfiler] // needs admin-rights +[EtwProfiler] // needs admin-rights #endif - public class HttpUserAgentParserBenchmarks +public class HttpUserAgentParserBenchmarks +{ + private string[] _testUserAgentMix; + private HttpUserAgentInformation[] _results; + + [GlobalSetup] + public void GlobalSetup() { - private string[] _testUserAgentMix; - private HttpUserAgentInformation[] _results; + _testUserAgentMix = GetTestUserAgents().ToArray(); + _results = new HttpUserAgentInformation[_testUserAgentMix.Length]; + } - [GlobalSetup] - public void GlobalSetup() - { - _testUserAgentMix = GetTestUserAgents().ToArray(); - _results = new HttpUserAgentInformation[_testUserAgentMix.Length]; - } + private static IEnumerable GetTestUserAgents() + { + yield return "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36"; + yield return "APIs-Google (+https://developers.google.com/webmasters/APIs-Google.html)"; + yield return "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0"; + yield return "yeah I'm unknown user agent, just to bring some fun to the mix"; + } - private static IEnumerable GetTestUserAgents() - { - yield return "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36"; - yield return "APIs-Google (+https://developers.google.com/webmasters/APIs-Google.html)"; - yield return "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0"; - yield return "yeah I'm unknown user agent, just to bring some fun to the mix"; - } + [Benchmark] + public void Parse() + { + string[] testUserAgentMix = _testUserAgentMix; + HttpUserAgentInformation[] results = _results; - [Benchmark] - public void Parse() + for (int i = 0; i < testUserAgentMix.Length; ++i) { - string[] testUserAgentMix = _testUserAgentMix; - HttpUserAgentInformation[] results = _results; - - for (int i = 0; i < testUserAgentMix.Length; ++i) - { - results[i] = HttpUserAgentParser.Parse(testUserAgentMix[i]); - } + results[i] = HttpUserAgentParser.Parse(testUserAgentMix[i]); } } } diff --git a/perf/MyCSharp.HttpUserAgentParser.Benchmarks/LibraryComparison/LibraryComparisonBenchmarks.cs b/perf/MyCSharp.HttpUserAgentParser.Benchmarks/LibraryComparison/LibraryComparisonBenchmarks.cs index 5d6d484..b6e6c86 100644 --- a/perf/MyCSharp.HttpUserAgentParser.Benchmarks/LibraryComparison/LibraryComparisonBenchmarks.cs +++ b/perf/MyCSharp.HttpUserAgentParser.Benchmarks/LibraryComparison/LibraryComparisonBenchmarks.cs @@ -1,6 +1,5 @@ // Copyright © myCSharp.de - all rights reserved -using System.Collections.Generic; using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Columns; using BenchmarkDotNet.Configs; diff --git a/perf/MyCSharp.HttpUserAgentParser.Benchmarks/MyCSharp.HttpUserAgentParser.Benchmarks.csproj b/perf/MyCSharp.HttpUserAgentParser.Benchmarks/MyCSharp.HttpUserAgentParser.Benchmarks.csproj index ff255f3..8f14c3b 100644 --- a/perf/MyCSharp.HttpUserAgentParser.Benchmarks/MyCSharp.HttpUserAgentParser.Benchmarks.csproj +++ b/perf/MyCSharp.HttpUserAgentParser.Benchmarks/MyCSharp.HttpUserAgentParser.Benchmarks.csproj @@ -2,7 +2,6 @@ Exe - net7.0;net8.0 disable diff --git a/perf/MyCSharp.HttpUserAgentParser.Benchmarks/Program.cs b/perf/MyCSharp.HttpUserAgentParser.Benchmarks/Program.cs index 799b89c..b4186c5 100644 --- a/perf/MyCSharp.HttpUserAgentParser.Benchmarks/Program.cs +++ b/perf/MyCSharp.HttpUserAgentParser.Benchmarks/Program.cs @@ -9,4 +9,6 @@ ManualConfig config = ManualConfig.Create(DefaultConfig.Instance) .WithOptions(ConfigOptions.DisableOptimizationsValidator); + +// dotnet run -c Release --framework net80 net90 --runtimes net90 BenchmarkSwitcher.FromAssembly(Assembly.GetExecutingAssembly()).Run(args, config); diff --git a/src/MyCSharp.HttpUserAgentParser.AspNetCore/MyCSharp.HttpUserAgentParser.AspNetCore.csproj b/src/MyCSharp.HttpUserAgentParser.AspNetCore/MyCSharp.HttpUserAgentParser.AspNetCore.csproj index c09b52c..c51f1f3 100644 --- a/src/MyCSharp.HttpUserAgentParser.AspNetCore/MyCSharp.HttpUserAgentParser.AspNetCore.csproj +++ b/src/MyCSharp.HttpUserAgentParser.AspNetCore/MyCSharp.HttpUserAgentParser.AspNetCore.csproj @@ -3,7 +3,6 @@ HTTP User Agent Parser Extensions for ASP.NET Core HTTP User Agent Parser Extensions for ASP.NET Core - net7.0;net8.0 diff --git a/src/MyCSharp.HttpUserAgentParser.MemoryCache/MyCSharp.HttpUserAgentParser.MemoryCache.csproj b/src/MyCSharp.HttpUserAgentParser.MemoryCache/MyCSharp.HttpUserAgentParser.MemoryCache.csproj index c5e54a4..ea9e432 100644 --- a/src/MyCSharp.HttpUserAgentParser.MemoryCache/MyCSharp.HttpUserAgentParser.MemoryCache.csproj +++ b/src/MyCSharp.HttpUserAgentParser.MemoryCache/MyCSharp.HttpUserAgentParser.MemoryCache.csproj @@ -3,7 +3,6 @@ HTTP User Agent Parser Extensions for IMemoryCache HTTP User Agent Parser Extensions for IMemoryCache - net7.0;net8.0 diff --git a/src/MyCSharp.HttpUserAgentParser/MyCSharp.HttpUserAgentParser.csproj b/src/MyCSharp.HttpUserAgentParser/MyCSharp.HttpUserAgentParser.csproj index 43add95..0180afe 100644 --- a/src/MyCSharp.HttpUserAgentParser/MyCSharp.HttpUserAgentParser.csproj +++ b/src/MyCSharp.HttpUserAgentParser/MyCSharp.HttpUserAgentParser.csproj @@ -3,7 +3,6 @@ HTTP User Agent Parser Parses user agents for Browser, Platform and Bots. - net7.0;net8.0 diff --git a/tests/MyCSharp.HttpUserAgentParser.AspNetCore.UnitTests/MyCSharp.HttpUserAgentParser.AspNetCore.UnitTests.csproj b/tests/MyCSharp.HttpUserAgentParser.AspNetCore.UnitTests/MyCSharp.HttpUserAgentParser.AspNetCore.UnitTests.csproj index 7831f35..3e6bd37 100644 --- a/tests/MyCSharp.HttpUserAgentParser.AspNetCore.UnitTests/MyCSharp.HttpUserAgentParser.AspNetCore.UnitTests.csproj +++ b/tests/MyCSharp.HttpUserAgentParser.AspNetCore.UnitTests/MyCSharp.HttpUserAgentParser.AspNetCore.UnitTests.csproj @@ -2,7 +2,6 @@ Exe - net7.0;net8.0 diff --git a/tests/MyCSharp.HttpUserAgentParser.MemoryCache.UnitTests/MyCSharp.HttpUserAgentParser.MemoryCache.UnitTests.csproj b/tests/MyCSharp.HttpUserAgentParser.MemoryCache.UnitTests/MyCSharp.HttpUserAgentParser.MemoryCache.UnitTests.csproj index 65fa6e2..1e6b572 100644 --- a/tests/MyCSharp.HttpUserAgentParser.MemoryCache.UnitTests/MyCSharp.HttpUserAgentParser.MemoryCache.UnitTests.csproj +++ b/tests/MyCSharp.HttpUserAgentParser.MemoryCache.UnitTests/MyCSharp.HttpUserAgentParser.MemoryCache.UnitTests.csproj @@ -2,7 +2,6 @@ Exe - net7.0;net8.0 diff --git a/tests/MyCSharp.HttpUserAgentParser.TestHelpers/MyCSharp.HttpUserAgentParser.TestHelpers.csproj b/tests/MyCSharp.HttpUserAgentParser.TestHelpers/MyCSharp.HttpUserAgentParser.TestHelpers.csproj index 8429490..dd0a1c7 100644 --- a/tests/MyCSharp.HttpUserAgentParser.TestHelpers/MyCSharp.HttpUserAgentParser.TestHelpers.csproj +++ b/tests/MyCSharp.HttpUserAgentParser.TestHelpers/MyCSharp.HttpUserAgentParser.TestHelpers.csproj @@ -1,9 +1,5 @@ - - net7.0;net8.0 - - false diff --git a/tests/MyCSharp.HttpUserAgentParser.UnitTests/MyCSharp.HttpUserAgentParser.UnitTests.csproj b/tests/MyCSharp.HttpUserAgentParser.UnitTests/MyCSharp.HttpUserAgentParser.UnitTests.csproj index ce2a835..4d2dcbb 100644 --- a/tests/MyCSharp.HttpUserAgentParser.UnitTests/MyCSharp.HttpUserAgentParser.UnitTests.csproj +++ b/tests/MyCSharp.HttpUserAgentParser.UnitTests/MyCSharp.HttpUserAgentParser.UnitTests.csproj @@ -2,7 +2,6 @@ Exe - net7.0;net8.0