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
2 changes: 1 addition & 1 deletion src/All.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
</Folder>
<Folder Name="/HotChocolate/Fusion/" />
<Folder Name="/HotChocolate/Fusion/benchmarks/">
<Project Path="HotChocolate/Fusion/benchmarks/Fusion.Execution.Benchmarks/Fusion.Execution.Benchmarks.csproj" />
<Project Path="HotChocolate/Fusion/benchmarks/Fusion.Execution.Benchmarks/HotChocolate.Fusion.Execution.Benchmarks.csproj" />
</Folder>
<Folder Name="/HotChocolate/Fusion/benchmarks/k6/">
<Project Path="HotChocolate/Fusion/benchmarks/k6/eShop.Gateway/eShop.Gateway.csproj" />
Expand Down
3 changes: 2 additions & 1 deletion src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
<PackageVersion Include="Basic.Reference.Assemblies.Net100" Version="1.8.7" />
<PackageVersion Include="Basic.Reference.Assemblies.Net80" Version="1.8.7" />
<PackageVersion Include="Basic.Reference.Assemblies.Net90" Version="1.8.7" />
<PackageVersion Include="BenchmarkDotNet" Version="0.15.4" />
<PackageVersion Include="BenchmarkDotNet" Version="0.15.8" />
<PackageVersion Include="BenchmarkDotNet.Diagnostics.dotMemory" Version="0.15.8" />
<PackageVersion Include="ChilliCream.ModelContextProtocol.AspNetCore" Version="1.3.0" />
<PackageVersion Include="ChilliCream.Nitro.App" Version="$(NitroVersion)" />
<PackageVersion Include="ChilliCream.Testing.Utilities" Version="0.2.0" />
Expand Down
2 changes: 1 addition & 1 deletion src/HotChocolate/Fusion/HotChocolate.Fusion.slnx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Solution>
<Folder Name="/benchmarks/">
<Project Path="benchmarks/Fusion.Execution.Benchmarks/Fusion.Execution.Benchmarks.csproj" />
<Project Path="benchmarks/Fusion.Execution.Benchmarks/HotChocolate.Fusion.Execution.Benchmarks.csproj" />
</Folder>
<Folder Name="/src/">
<Project Path="src/Fusion.Aspire/HotChocolate.Fusion.Aspire.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using HotChocolate.Fusion.Planning;
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.RewriteDocument(_simpleQueryWithRequirements).GetOperation(operationName: null);
}

[Benchmark]
public OperationDefinitionNode Rewrite_Complex_Query()
{
return _documentRewriter.RewriteDocument(_complexQuery).GetOperation(operationName: null);
}

[Benchmark]
public OperationDefinitionNode Rewrite_ConditionalRedundancy_Query()
{
return _documentRewriter.RewriteDocument(_conditionalRedundancyQuery).GetOperation(operationName: null);
}
}
Loading
Loading