diff --git a/src/HotChocolate/Fusion/src/Fusion.Execution/Configuration/FusionMemoryPoolOptions.cs b/src/HotChocolate/Fusion/src/Fusion.Execution/Configuration/FusionMemoryPoolOptions.cs deleted file mode 100644 index 9c6327d28cc..00000000000 --- a/src/HotChocolate/Fusion/src/Fusion.Execution/Configuration/FusionMemoryPoolOptions.cs +++ /dev/null @@ -1,32 +0,0 @@ -namespace HotChocolate.Fusion.Configuration; - -public sealed class FusionMemoryPoolOptions -{ - public int ObjectBatchSize { get; set; } = 64; - public int DefaultObjectCapacity { get; set; } = 64; - public int MaxAllowedObjectCapacity { get; set; } = 512; - - public int ListBatchSize { get; set; } = 128; - public int DefaultListCapacity { get; set; } = 64; - public int MaxAllowedListCapacity { get; set; } = 512; - - public int LeafFieldBatchSize { get; set; } = 512; - public int ListFieldBatchSize { get; set; } = 128; - public int ObjectFieldBatchSize { get; set; } = 128; - - public FusionMemoryPoolOptions Clone() - { - return new FusionMemoryPoolOptions - { - ObjectBatchSize = ObjectBatchSize, - DefaultObjectCapacity = DefaultObjectCapacity, - MaxAllowedObjectCapacity = MaxAllowedObjectCapacity, - ListBatchSize = ListBatchSize, - DefaultListCapacity = DefaultListCapacity, - MaxAllowedListCapacity = MaxAllowedListCapacity, - LeafFieldBatchSize = LeafFieldBatchSize, - ListFieldBatchSize = ListFieldBatchSize, - ObjectFieldBatchSize = ObjectFieldBatchSize - }; - } -} diff --git a/src/HotChocolate/Fusion/src/Fusion.Execution/DependencyInjection/HotChocolateFusionServiceCollectionExtensions.cs b/src/HotChocolate/Fusion/src/Fusion.Execution/DependencyInjection/HotChocolateFusionServiceCollectionExtensions.cs index 3a1fafc422b..a8af77bfb98 100644 --- a/src/HotChocolate/Fusion/src/Fusion.Execution/DependencyInjection/HotChocolateFusionServiceCollectionExtensions.cs +++ b/src/HotChocolate/Fusion/src/Fusion.Execution/DependencyInjection/HotChocolateFusionServiceCollectionExtensions.cs @@ -15,11 +15,9 @@ 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); @@ -27,7 +25,6 @@ public static IFusionGatewayBuilder AddGraphQLGateway( AddCore(services); AddRequestExecutorManager(services); AddSourceSchemaScope(services); - AddResultObjectPools(services, options.Clone()); return CreateBuilder(services, name); } @@ -67,15 +64,6 @@ private static void AddSourceSchemaScope( sp.GetRequiredService())); } - // TODO : REVIEW IF THIS IS STILL NEEDED - internal static void AddResultObjectPools( - IServiceCollection services, - FusionMemoryPoolOptions options) - { - services.TryAddSingleton(static _ => new DefaultObjectPoolProvider()); - services.TryAddSingleton(options); - } - private static DefaultFusionGatewayBuilder CreateBuilder( IServiceCollection services, string name) @@ -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) diff --git a/src/HotChocolate/Fusion/src/Fusion.Execution/Text/Json/PathSegmentMemory.cs b/src/HotChocolate/Fusion/src/Fusion.Execution/Text/Json/PathSegmentMemory.cs index 194a511a4e0..4624dde7e80 100644 --- a/src/HotChocolate/Fusion/src/Fusion.Execution/Text/Json/PathSegmentMemory.cs +++ b/src/HotChocolate/Fusion/src/Fusion.Execution/Text/Json/PathSegmentMemory.cs @@ -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); diff --git a/src/HotChocolate/Utilities/src/Utilities.Buffers/JsonMemory.cs b/src/HotChocolate/Utilities/src/Utilities.Buffers/JsonMemory.cs index e7a996d8c19..acf6401b218 100644 --- a/src/HotChocolate/Utilities/src/Utilities.Buffers/JsonMemory.cs +++ b/src/HotChocolate/Utilities/src/Utilities.Buffers/JsonMemory.cs @@ -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 s_chunkPool = ArrayPool.Shared;