-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/add-whatsapp
- Loading branch information
Showing
14 changed files
with
47 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"sdk": { | ||
"version": "8.0.100" | ||
"version": "9.0.100-rc.1.24452.12" | ||
} | ||
} |
62 changes: 31 additions & 31 deletions
62
perf/MyCSharp.HttpUserAgentParser.Benchmarks/HttpUserAgentParserBenchmarks.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<string> 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<string> 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]); | ||
} | ||
} | ||
} |
1 change: 0 additions & 1 deletion
1
.../MyCSharp.HttpUserAgentParser.Benchmarks/LibraryComparison/LibraryComparisonBenchmarks.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 0 additions & 4 deletions
4
.../MyCSharp.HttpUserAgentParser.TestHelpers/MyCSharp.HttpUserAgentParser.TestHelpers.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters