Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions src/HotChocolate/AspNetCore/benchmarks/k6/performance-data.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"timestamp": "2025-10-23T16:02:23Z",
"timestamp": "2025-10-23T19:09:41Z",
"tests": {
"single-fetch": {
"name": "Single Fetch (50 products, names only)",
"response_time": {
"min": 1.447863,
"p50": 2.751327,
"max": 58.155978,
"avg": 3.0016228840274928,
"p90": 4.130812,
"p95": 4.938353,
"p99": 7.987915299999998
"min": 1.311196,
"p50": 1.763142,
"max": 50.855832,
"avg": 1.968737330531039,
"p90": 2.5424552000000005,
"p95": 2.9549014,
"p99": 5.398412600000002
},
"throughput": {
"requests_per_second": 78.71047667816899,
"total_iterations": 7162
"requests_per_second": 78.78513545438359,
"total_iterations": 7168
},
"reliability": {
"error_rate": 0
Expand All @@ -23,17 +23,17 @@
"dataloader": {
"name": "DataLoader (50 products with brands)",
"response_time": {
"min": 2.924864,
"p50": 4.8340905,
"max": 24.782141,
"avg": 5.312051972269166,
"p90": 7.203395599999999,
"p95": 8.972791199999993,
"p99": 12.379031920000001
"min": 2.581101,
"p50": 3.39728,
"max": 19.088613,
"avg": 3.776861670740273,
"p90": 5.147565999999999,
"p95": 6.316323699999998,
"p99": 8.866344979999997
},
"throughput": {
"requests_per_second": 78.41421668508127,
"total_iterations": 7135
"requests_per_second": 78.61021441670597,
"total_iterations": 7150
},
"reliability": {
"error_rate": 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ public async Task HotChocolateStyle_Sha1Hash_Success()

var server = CreateStarWarsServer(
configureServices: s => s
.AddSha1DocumentHashProvider(HashFormat.Hex)
.AddGraphQL("StarWars")
.AddSha1DocumentHashProvider(HashFormat.Hex)
.ConfigureSchemaServices(c => c.AddSingleton<IOperationDocumentStorage>(storage))
.UsePersistedOperationPipeline());

Expand All @@ -100,8 +100,8 @@ public async Task HotChocolateStyle_Sha256Hash_Success()

var server = CreateStarWarsServer(
configureServices: s => s
.AddSha256DocumentHashProvider(HashFormat.Hex)
.AddGraphQL("StarWars")
.AddSha256DocumentHashProvider(HashFormat.Hex)
.ConfigureSchemaServices(c => c.AddSingleton<IOperationDocumentStorage>(storage))
.UsePersistedOperationPipeline());

Expand All @@ -127,8 +127,8 @@ public async Task HotChocolateStyle_Sha256Hash_Query_Empty_String_Success()

var server = CreateStarWarsServer(
configureServices: s => s
.AddSha256DocumentHashProvider(HashFormat.Hex)
.AddGraphQL("StarWars")
.AddSha256DocumentHashProvider(HashFormat.Hex)
.ConfigureSchemaServices(c => c.AddSingleton<IOperationDocumentStorage>(storage))
.UsePersistedOperationPipeline());

Expand Down Expand Up @@ -211,8 +211,8 @@ public async Task ApolloStyle_Sha1Hash_Success()

var server = CreateStarWarsServer(
configureServices: s => s
.AddSha1DocumentHashProvider(HashFormat.Hex)
.AddGraphQL("StarWars")
.AddSha1DocumentHashProvider(HashFormat.Hex)
.ConfigureSchemaServices(c => c.AddSingleton<IOperationDocumentStorage>(storage))
.UsePersistedOperationPipeline());

Expand All @@ -238,8 +238,8 @@ public async Task ApolloStyle_Sha256Hash_Success()

var server = CreateStarWarsServer(
configureServices: s => s
.AddSha256DocumentHashProvider(HashFormat.Hex)
.AddGraphQL("StarWars")
.AddSha256DocumentHashProvider(HashFormat.Hex)
.ConfigureSchemaServices(c => c.AddSingleton<IOperationDocumentStorage>(storage))
.UsePersistedOperationPipeline());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,6 @@ internal static IServiceCollection TryAddRequestExecutorResolver(
return services;
}

internal static IServiceCollection TryAddDefaultDocumentHashProvider(
this IServiceCollection services)
{
services.TryAddSingleton<IDocumentHashProvider>(
_ => new MD5DocumentHashProvider(HashFormat.Hex));
return services;
}

internal static IServiceCollection TryAddDefaultBatchDispatcher(
this IServiceCollection services,
BatchDispatcherOptions options)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using HotChocolate.Execution.Configuration;
using HotChocolate.Language;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;

namespace Microsoft.Extensions.DependencyInjection;

public static partial class RequestExecutorBuilderExtensions
{
public static IRequestExecutorBuilder AddMD5DocumentHashProvider(
this IRequestExecutorBuilder builder,
HashFormat format = HashFormat.Base64)
{
return builder.ConfigureSchemaServices(services =>
{
services.RemoveAll<IDocumentHashProvider>();
services.AddSingleton<IDocumentHashProvider>(new MD5DocumentHashProvider(format));
});
}

public static IRequestExecutorBuilder AddSha1DocumentHashProvider(
this IRequestExecutorBuilder builder,
HashFormat format = HashFormat.Base64)
{
return builder.ConfigureSchemaServices(services =>
{
services.RemoveAll<IDocumentHashProvider>();
services.AddSingleton<IDocumentHashProvider>(new Sha1DocumentHashProvider(format));
});
}

public static IRequestExecutorBuilder AddSha256DocumentHashProvider(
this IRequestExecutorBuilder builder,
HashFormat format = HashFormat.Base64)
{
return builder.ConfigureSchemaServices(services =>
{
services.RemoveAll<IDocumentHashProvider>();
services.AddSingleton<IDocumentHashProvider>(new Sha256DocumentHashProvider(format));
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public static IServiceCollection AddGraphQLCore(this IServiceCollection services
.TryAddTypeConverter()
.TryAddInputFormatter()
.TryAddInputParser()
.TryAddDefaultDocumentHashProvider()
.TryAddDefaultBatchDispatcher(default)
.TryAddDefaultDataLoaderRegistry()
.TryAddDataLoaderParameterExpressionBuilder()
Expand Down Expand Up @@ -168,36 +167,6 @@ private static DefaultRequestExecutorBuilder CreateBuilder(
return builder;
}

public static IServiceCollection AddMD5DocumentHashProvider(
this IServiceCollection services,
HashFormat format = HashFormat.Base64)
{
services.RemoveAll<IDocumentHashProvider>();
services.AddSingleton<IDocumentHashProvider>(
new MD5DocumentHashProvider(format));
return services;
}

public static IServiceCollection AddSha1DocumentHashProvider(
this IServiceCollection services,
HashFormat format = HashFormat.Base64)
{
services.RemoveAll<IDocumentHashProvider>();
services.AddSingleton<IDocumentHashProvider>(
new Sha1DocumentHashProvider(format));
return services;
}

public static IServiceCollection AddSha256DocumentHashProvider(
this IServiceCollection services,
HashFormat format = HashFormat.Base64)
{
services.RemoveAll<IDocumentHashProvider>();
services.AddSingleton<IDocumentHashProvider>(
new Sha256DocumentHashProvider(format));
return services;
}

public static IServiceCollection AddBatchDispatcher<T>(this IServiceCollection services)
where T : class, IBatchDispatcher
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@
<Compile Update="DependencyInjection\RequestExecutorBuilderExtensions.Caches.cs">
<DependentUpon>RequestExecutorBuilderExtensions.cs</DependentUpon>
</Compile>
<Compile Update="DependencyInjection\RequestExecutorBuilderExtensions.Hashing.cs">
<DependentUpon>RequestExecutorBuilderExtensions.cs</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,7 @@ await typeModuleChangeMonitor.ConfigureAsync(context, cancellationToken)
serviceCollection.AddSingleton<IErrorHandler, DefaultErrorHandler>();
serviceCollection.AddSingleton(
static sp => sp.GetRootServiceProvider().GetRequiredService<ParserOptions>());
serviceCollection.AddSingleton(
static sp => sp.GetRootServiceProvider().GetRequiredService<IDocumentHashProvider>());
serviceCollection.AddSingleton<IDocumentHashProvider>(static _ => new MD5DocumentHashProvider(HashFormat.Hex));

serviceCollection.TryAddDiagnosticEvents();
serviceCollection.TryAddOperationExecutors();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using HotChocolate.Fusion.Configuration;
using HotChocolate.Language;
using Microsoft.Extensions.DependencyInjection.Extensions;

namespace Microsoft.Extensions.DependencyInjection;

public static partial class CoreFusionGatewayBuilderExtensions
{
public static IFusionGatewayBuilder AddMD5DocumentHashProvider(
this IFusionGatewayBuilder builder,
HashFormat format = HashFormat.Base64)
{
return builder.ConfigureSchemaServices((_, services) =>
{
services.RemoveAll<IDocumentHashProvider>();
services.AddSingleton<IDocumentHashProvider>(new MD5DocumentHashProvider(format));
});
}

public static IFusionGatewayBuilder AddSha1DocumentHashProvider(
this IFusionGatewayBuilder builder,
HashFormat format = HashFormat.Base64)
{
return builder.ConfigureSchemaServices((_, services) =>
{
services.RemoveAll<IDocumentHashProvider>();
services.AddSingleton<IDocumentHashProvider>(new Sha1DocumentHashProvider(format));
});
}

public static IFusionGatewayBuilder AddSha256DocumentHashProvider(
this IFusionGatewayBuilder builder,
HashFormat format = HashFormat.Base64)
{
return builder.ConfigureSchemaServices((_, services) =>
{
services.RemoveAll<IDocumentHashProvider>();
services.AddSingleton<IDocumentHashProvider>(new Sha256DocumentHashProvider(format));
});
}
}
Loading