Skip to content

Commit

Permalink
Simplify benchmarks
Browse files Browse the repository at this point in the history
- Remove need for custom configuration now that `UseArtifactsOutput` is supported.
- Use collection expression.
- Simplify class declaration.
  • Loading branch information
martincostello committed Aug 7, 2024
1 parent bb85ee9 commit 6c59e4f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 26 deletions.
21 changes: 0 additions & 21 deletions tests/HttpClientInterception.Benchmarks/CustomBenchmarkConfig.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@
namespace JustEat.HttpClientInterception;

[JsonSerializable(typeof(GitHubOrganization))]
internal sealed partial class GitHubJsonSerializerContext : JsonSerializerContext
{
}
internal sealed partial class GitHubJsonSerializerContext : JsonSerializerContext;
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
using System.Net.Http.Json;
using System.Text.Json;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Diagnosers;
using Refit;

namespace JustEat.HttpClientInterception;

[Config(typeof(CustomBenchmarkConfig))]
[EventPipeProfiler(EventPipeProfile.CpuSampling)]
[MemoryDiagnoser]
public class InterceptionBenchmarks
{
private readonly HttpClientInterceptorOptions _options;
Expand Down Expand Up @@ -40,7 +42,7 @@ public InterceptionBenchmarks()
.ForQuery(string.Empty)
.Responds()
.WithMediaType("application/octet-stream")
.WithContent(() => new byte[] { 0, 1, 2, 3, 4 })
.WithContent(() => [0, 1, 2, 3, 4])
.RegisterWith(_options);

builder
Expand Down

0 comments on commit 6c59e4f

Please sign in to comment.