Skip to content
Draft
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
1 change: 1 addition & 0 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<PackageVersion Include="Basic.Reference.Assemblies.Net100" Version="1.8.3" />
<PackageVersion Include="Basic.Reference.Assemblies.Net80" Version="1.8.3" />
<PackageVersion Include="Basic.Reference.Assemblies.Net90" Version="1.8.3" />
<PackageVersion Include="BenchmarkDotNet.Diagnostics.dotMemory" Version="0.15.4" />
<PackageVersion Include="CaseConverter" Version="2.0.1" />
<PackageVersion Include="ChilliCream.ModelContextProtocol.AspNetCore" Version="0.0.1-p.2" />
<PackageVersion Include="ChilliCream.Nitro.App" Version="$(NitroVersion)" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using HotChocolate.Fusion.Rewriters;
using HotChocolate.Language;

namespace Fusion.Execution.Benchmarks;

[MemoryDiagnoser]
[ShortRunJob(RuntimeMoniker.Net10_0)]
[MarkdownExporter]
public class DocumentRewriterBenchmark : FusionBenchmarkBase
{
private DocumentRewriter _documentRewriter = null!;

private DocumentNode _simpleQueryWithRequirements = null!;
private DocumentNode _complexQuery = null!;
private DocumentNode _conditionalRedundancyQuery = null!;

[GlobalSetup]
public void GlobalSetup()
{
_simpleQueryWithRequirements = CreateSimpleQueryWithRequirementsDocument();
_complexQuery = CreateComplexDocument();
_conditionalRedundancyQuery = CreateConditionalRedundancyDocument();

var schema = CreateFusionSchema();

_documentRewriter = new DocumentRewriter(schema);
}

[Benchmark]
public OperationDefinitionNode Rewrite_Simple_Query_With_Requirements()
{
return _documentRewriter.RewriteOperation(_simpleQueryWithRequirements);
}

[Benchmark]
public OperationDefinitionNode Rewrite_Complex_Query()
{
return _documentRewriter.RewriteOperation(_complexQuery);
}

[Benchmark]
public OperationDefinitionNode Rewrite_ConditionalRedundancy_Query()
{
return _documentRewriter.RewriteOperation(_conditionalRedundancyQuery);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" VersionOverride="0.15.4" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.dotMemory" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" VersionOverride="10.0.0-rc.1.25451.107" />

</ItemGroup>
Expand All @@ -19,6 +20,7 @@
<ProjectReference Include="..\..\..\AspNetCore\src\Transport.Abstractions\HotChocolate.Transport.Abstractions.csproj" />
<ProjectReference Include="..\..\..\AspNetCore\src\Transport.Http\HotChocolate.Transport.Http.csproj" />
<ProjectReference Include="..\..\..\Core\src\Execution.Configuration.Abstractions\HotChocolate.Execution.Configuration.Abstractions.csproj" />
<ProjectReference Include="..\..\src\Fusion.Composition\HotChocolate.Fusion.Composition.csproj" />
<ProjectReference Include="..\..\src\Fusion.Execution\HotChocolate.Fusion.Execution.csproj" />
</ItemGroup>

Expand Down
Loading
Loading