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

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,16 @@ public static class HotChocolateFusionServiceCollectionExtensions
{
public static IFusionGatewayBuilder AddGraphQLGateway(
this IServiceCollection services,
string? name = null,
FusionMemoryPoolOptions? options = null)
string? name = null)
{
name ??= ISchemaDefinition.DefaultName;
options ??= new FusionMemoryPoolOptions();

ArgumentNullException.ThrowIfNull(services);
ArgumentException.ThrowIfNullOrEmpty(name);

AddCore(services);
AddRequestExecutorManager(services);
AddSourceSchemaScope(services);
AddResultObjectPools(services, options.Clone());

return CreateBuilder(services, name);
}
Expand Down Expand Up @@ -67,15 +64,6 @@ private static void AddSourceSchemaScope(
sp.GetRequiredService<IHttpClientFactory>()));
}

// TODO : REVIEW IF THIS IS STILL NEEDED
internal static void AddResultObjectPools(
IServiceCollection services,
FusionMemoryPoolOptions options)
{
services.TryAddSingleton<ObjectPoolProvider>(static _ => new DefaultObjectPoolProvider());
services.TryAddSingleton(options);
}

private static DefaultFusionGatewayBuilder CreateBuilder(
IServiceCollection services,
string name)
Expand All @@ -99,7 +87,7 @@ private static void AddFetchResultStorePool(this IFusionGatewayBuilder builder)
=> builder.ConfigureSchemaServices(
static (_, s) => s.TryAddSingleton(
new FetchResultStorePool(
levels: [4, 16, 64],
levels: [64, 128, 256, 512],
trimInterval: TimeSpan.FromMinutes(5))));

private static IFusionGatewayBuilder AddDocumentCache(this IFusionGatewayBuilder builder)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ internal static class PathSegmentMemory
{
private static PathSegmentPool s_pool = new(
segmentArraySize: 64,
levels: [4096, 8192, 16384],
levels: [4096, 8192, 16384, 32768, 65536],
trimInterval: TimeSpan.FromMinutes(5),
preAllocate: false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ internal static class JsonMemory
new FixedSizeArrayPool(
FixedSizeArrayPoolKinds.JsonMemory,
arraySize: BufferSize,
[128, 768, 3072],
[128, 768, 3072, 4100, 5128, 6156],
trimInterval: TimeSpan.FromMinutes(5),
preAllocate: false);
private static readonly ArrayPool<byte[]> s_chunkPool = ArrayPool<byte[]>.Shared;
Expand Down
Loading