Skip to content

Commit da13e37

Browse files
committed
perf(benchmarks): update benchmark configurations and results
1 parent 2ccdd27 commit da13e37

File tree

3 files changed

+40
-17
lines changed

3 files changed

+40
-17
lines changed

.vscode/settings.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
// github copilot commit message instructions (preview)
3+
"github.copilot.chat.commitMessageGeneration.instructions": [
4+
{ "text": "Use conventional commit format: type(scope): description" },
5+
{ "text": "Use imperative mood: 'Add feature' not 'Added feature'" },
6+
{ "text": "Keep subject line under 50 characters" },
7+
{ "text": "Use types: feat, fix, docs, style, refactor, perf, test, chore, ci" },
8+
{ "text": "Include scope when relevant (e.g., api, ui, auth)" },
9+
{ "text": "Reference issue numbers with # prefix" }
10+
]
11+
}

README.md

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -85,24 +85,32 @@ clientHints.Headers.TryGetValue("Sec-CH-UA-Bitness", out StringValues bitness);
8585
## Benchmark
8686

8787
```shell
88-
BenchmarkDotNet v0.14.0, Windows 10 (10.0.19045.6216/22H2/2022Update)
89-
AMD Ryzen 9 9950X, 1 CPU, 32 logical and 16 physical cores
88+
BenchmarkDotNet v0.15.2, Windows 10 (10.0.19045.6216/22H2/2022Update)
89+
AMD Ryzen 9 9950X 4.30GHz, 1 CPU, 32 logical and 16 physical cores
9090
.NET SDK 10.0.100-preview.7.25380.108
91-
[Host] : .NET 10.0.0 (10.0.25.38108), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
92-
.NET 8.0 : .NET 8.0.19 (8.0.1925.36514), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
93-
.NET 9.0 : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
94-
95-
96-
| Method | Job | Runtime | Mean | Error | StdDev | Gen0 | Allocated |
97-
|------------------------------------------------------- |--------- |--------- |----------:|---------:|---------:|-------:|----------:|
98-
| 'View: read few properties (no alloc)' | .NET 8.0 | .NET 8.0 | 29.42 ns | 0.205 ns | 0.181 ns | - | - |
99-
| 'View: BuildSnapshot (alloc 1)' | .NET 8.0 | .NET 8.0 | 67.37 ns | 0.624 ns | 0.584 ns | 0.0052 | 88 B |
100-
| 'Extension: GetClientHints(headers) (alloc 1)' | .NET 8.0 | .NET 8.0 | 66.60 ns | 0.552 ns | 0.461 ns | 0.0052 | 88 B |
101-
| 'Extension: GetClientHints(context) (alloc 1, cached)' | .NET 8.0 | .NET 8.0 | 108.18 ns | 1.039 ns | 0.972 ns | 0.0052 | 88 B |
102-
| 'View: read few properties (no alloc)' | .NET 9.0 | .NET 9.0 | 31.48 ns | 0.171 ns | 0.152 ns | - | - |
103-
| 'View: BuildSnapshot (alloc 1)' | .NET 9.0 | .NET 9.0 | 66.71 ns | 0.606 ns | 0.473 ns | - | - |
104-
| 'Extension: GetClientHints(headers) (alloc 1)' | .NET 9.0 | .NET 9.0 | 65.92 ns | 0.270 ns | 0.239 ns | - | - |
105-
| 'Extension: GetClientHints(context) (alloc 1, cached)' | .NET 9.0 | .NET 9.0 | 116.13 ns | 1.304 ns | 1.219 ns | 0.0052 | 88 B |
91+
[Host] : .NET 10.0.0 (10.0.25.38108), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
92+
.NET 10.0 : .NET 10.0.0 (10.0.25.38108), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
93+
.NET 8.0 : .NET 8.0.19 (8.0.1925.36514), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
94+
.NET 9.0 : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
95+
96+
97+
| Method | Job | Runtime | Mean | Error | StdDev | Gen0 | Allocated |
98+
|------------------------------------------------------- |---------- |---------- |----------:|---------:|---------:|-------:|----------:|
99+
| 'View: read few properties (no alloc)' | .NET 8.0 | .NET 8.0 | 31.26 ns | 0.403 ns | 0.377 ns | - | - |
100+
| 'View: read few properties (no alloc)' | .NET 9.0 | .NET 9.0 | 34.50 ns | 0.328 ns | 0.307 ns | - | - |
101+
| 'View: read few properties (no alloc)' | .NET 10.0 | .NET 10.0 | 21.71 ns | 0.397 ns | 0.371 ns | - | - |
102+
| | | | | | | | |
103+
| 'View: BuildSnapshot (alloc 1)' | .NET 8.0 | .NET 8.0 | 70.83 ns | 1.058 ns | 0.884 ns | 0.0052 | 88 B |
104+
| 'View: BuildSnapshot (alloc 1)' | .NET 9.0 | .NET 9.0 | 67.35 ns | 0.462 ns | 0.409 ns | - | - |
105+
| 'View: BuildSnapshot (alloc 1)' | .NET 10.0 | .NET 10.0 | 44.59 ns | 0.599 ns | 0.561 ns | - | - |
106+
| | | | | | | | |
107+
| 'Extension: GetClientHints(headers) (alloc 1)' | .NET 8.0 | .NET 8.0 | 70.32 ns | 0.872 ns | 0.816 ns | 0.0052 | 88 B |
108+
| 'Extension: GetClientHints(headers) (alloc 1)' | .NET 9.0 | .NET 9.0 | 67.24 ns | 0.506 ns | 0.473 ns | - | - |
109+
| 'Extension: GetClientHints(headers) (alloc 1)' | .NET 10.0 | .NET 10.0 | 46.50 ns | 0.254 ns | 0.212 ns | - | - |
110+
| | | | | | | | |
111+
| 'Extension: GetClientHints(context) (alloc 1, cached)' | .NET 8.0 | .NET 8.0 | 111.04 ns | 0.767 ns | 0.718 ns | 0.0052 | 88 B |
112+
| 'Extension: GetClientHints(context) (alloc 1, cached)' | .NET 9.0 | .NET 9.0 | 114.79 ns | 2.304 ns | 2.155 ns | 0.0052 | 88 B |
113+
| 'Extension: GetClientHints(context) (alloc 1, cached)' | .NET 10.0 | .NET 10.0 | 98.26 ns | 1.429 ns | 1.267 ns | 0.0052 | 88 B |
106114
```
107115

108116
## Samples

perf/HttpClientHints.Benchmarks/HttpClientHintBenchmarks.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
using BenchmarkDotNet.Attributes;
44
using BenchmarkDotNet.Jobs;
5+
using BenchmarkDotNet.Order;
6+
using BenchmarkDotNet.Configs;
57
using Microsoft.AspNetCore.Http;
68
using Microsoft.Extensions.Primitives;
79
using MyCSharp.HttpClientHints.AspNetCore;
@@ -15,6 +17,8 @@ namespace HttpClientHints.Benchmarks;
1517
[SimpleJob(RuntimeMoniker.Net80)]
1618
[SimpleJob(RuntimeMoniker.Net90)]
1719
[SimpleJob(RuntimeMoniker.Net10_0)]
20+
[Orderer(SummaryOrderPolicy.Method, MethodOrderPolicy.Declared)]
21+
[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByMethod)]
1822
public class HttpClientHintBenchmarks
1923
{
2024
private HeaderDictionary _headers = null!;

0 commit comments

Comments
 (0)