Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/aspnetcore.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/Http/Routing/perf/Microbenchmarks/Matching/FastPathTokenizerPlaintextBenchmark.cs')
-rw-r--r--src/Http/Routing/perf/Microbenchmarks/Matching/FastPathTokenizerPlaintextBenchmark.cs39
1 files changed, 19 insertions, 20 deletions
diff --git a/src/Http/Routing/perf/Microbenchmarks/Matching/FastPathTokenizerPlaintextBenchmark.cs b/src/Http/Routing/perf/Microbenchmarks/Matching/FastPathTokenizerPlaintextBenchmark.cs
index df16357fec..fd1b881156 100644
--- a/src/Http/Routing/perf/Microbenchmarks/Matching/FastPathTokenizerPlaintextBenchmark.cs
+++ b/src/Http/Routing/perf/Microbenchmarks/Matching/FastPathTokenizerPlaintextBenchmark.cs
@@ -4,30 +4,29 @@
using System;
using BenchmarkDotNet.Attributes;
-namespace Microsoft.AspNetCore.Routing.Matching
+namespace Microsoft.AspNetCore.Routing.Matching;
+
+public class FastPathTokenizerPlaintextBenchmark : FastPathTokenizerBenchmarkBase
{
- public class FastPathTokenizerPlaintextBenchmark : FastPathTokenizerBenchmarkBase
- {
- private const int MaxCount = 32;
- private static readonly string Input = "/plaintext";
+ private const int MaxCount = 32;
+ private static readonly string Input = "/plaintext";
- // This is super hardcoded implementation for comparison, we dont't expect to do better.
- [Benchmark(Baseline = true)]
- public unsafe void Baseline()
- {
- var path = Input;
- var segments = stackalloc PathSegment[MaxCount];
+ // This is super hardcoded implementation for comparison, we dont't expect to do better.
+ [Benchmark(Baseline = true)]
+ public unsafe void Baseline()
+ {
+ var path = Input;
+ var segments = stackalloc PathSegment[MaxCount];
- MinimalBaseline(path, segments, MaxCount);
- }
+ MinimalBaseline(path, segments, MaxCount);
+ }
- [Benchmark]
- public void Implementation()
- {
- var path = Input;
- Span<PathSegment> segments = stackalloc PathSegment[MaxCount];
+ [Benchmark]
+ public void Implementation()
+ {
+ var path = Input;
+ Span<PathSegment> segments = stackalloc PathSegment[MaxCount];
- FastPathTokenizer.Tokenize(path, segments);
- }
+ FastPathTokenizer.Tokenize(path, segments);
}
}