Skip to content

Add more validation benchmarks#7654

Merged
glen-84 merged 11 commits intomainfrom
gai/validation-benchmarks
Feb 19, 2026
Merged

Add more validation benchmarks#7654
glen-84 merged 11 commits intomainfrom
gai/validation-benchmarks

Conversation

@glen-84
Copy link
Copy Markdown
Member

@glen-84 glen-84 commented Oct 29, 2024

Summary of the changes (Less than 80 chars)

  • Add more validation benchmarks.

@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 29, 2024

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (7dd8976) to head (9ca52a1).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff      @@
##   main   #7654   +/-   ##
============================
============================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@glen-84 glen-84 marked this pull request as ready for review February 19, 2026 17:53
Copilot AI review requested due to automatic review settings February 19, 2026 17:53
@glen-84 glen-84 changed the title Added validation benchmarks Add more validation benchmarks Feb 19, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds comprehensive validation benchmarks for the HotChocolate GraphQL framework. The PR introduces a new benchmark suite to measure validation performance across different schema sizes and query complexities, enabling performance tracking and optimization of the validation pipeline.

Changes:

  • Added ValidationBenchmarkBase abstract class to share common setup logic across benchmarks
  • Created four new benchmark classes testing validation with different schema/query combinations (many fragments, large schema variations, and extra-large schema)
  • Added extensive GraphQL schema and query resource files for benchmark scenarios
  • Updated Program.cs to support running all benchmarks and modified OverlappingFieldsMergedBenchmark to remove unused imports
  • Added solution file (Benchmarks.slnx) to organize benchmark projects
  • Updated project configuration to copy resource files to output directory

Reviewed changes

Copilot reviewed 14 out of 18 changed files in this pull request and generated no comments.

Show a summary per file
File Description
ValidationBenchmarkBase.cs Base class providing shared setup for loading schemas and documents, with custom scalar handling
ManyFragmentsBenchmark.cs Benchmark for validating queries with many fragments
LargeSchema1Benchmark.cs Benchmark for validating against first large schema variant
LargeSchema2Benchmark.cs Benchmark for validating against second large schema variant
ExtraLargeSchema1Benchmark.cs Benchmark for validating against extra-large schema
Program.cs Updated to use RunAllJoined for executing all benchmarks
OverlappingFieldsMergedBenchmark.cs Cleanup of unused using statements
HotChocolate.Validation.Benchmarks.csproj Added resource file copy configuration
Benchmarks.slnx New solution file organizing benchmark projects
resources/*.graphql(s) GraphQL schema definitions and queries for benchmarking
dictionary.txt Added "Diagnoser" to custom dictionary
Comments suppressed due to low confidence (2)

src/HotChocolate/Core/benchmarks/Validation.Benchmarks/Program.cs:5

  • The Program.cs uses RunAllJoined(null, args) which is different from the existing pattern in Execution.Abstractions.Benchmarks that uses Run(args). The RunAllJoined method runs all benchmarks in a single execution, which may not be the intended behavior for benchmarking. Consider using .Run(args) instead to maintain consistency with the existing benchmark pattern and allow selective benchmark execution via command-line arguments.
BenchmarkSwitcher
    .FromAssembly(typeof(Program).Assembly)
    .RunAllJoined(null, args);

src/HotChocolate/Core/benchmarks/Validation.Benchmarks/ValidationBenchmarkBase.cs:4

  • The unused import Microsoft.Extensions.DependencyInjection should be removed as it's not used anywhere in the ValidationBenchmarkBase class.
using Microsoft.Extensions.DependencyInjection;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@glen-84 glen-84 merged commit 0d70983 into main Feb 19, 2026
117 checks passed
@glen-84 glen-84 deleted the gai/validation-benchmarks branch February 19, 2026 18:09
@github-actions
Copy link
Copy Markdown
Contributor

Fusion Gateway Performance Results

Simple Composite Query

Req/s Err%
Constant (50 VUs) 2904.52 0.00%
Ramping (0-500-0 VUs) 3297.04 0.00%
Response Times & Query
Min Med Avg P90 P95 Max
Constant 0.79ms 15.20ms 16.99ms 30.64ms 36.14ms 171.78ms
Ramping 0.79ms 65.73ms 67.52ms 127.00ms 142.86ms 250.18ms
query TestQuery {
  topProducts(first: 5) {
    inStock
    name
    price
    shippingEstimate
    upc
    weight
    reviews {
      id
      body
      author {
        id
        username
        name
      }
    }
  }
}

Deep Recursion Query

Req/s Err%
Constant (50 VUs) 745.06 0.00%
Ramping (0-500-0 VUs) 834.57 0.00%
Response Times & Query
Min Med Avg P90 P95 Max
Constant 9.56ms 62.37ms 65.52ms 80.99ms 89.90ms 384.92ms
Ramping 1.79ms 247.72ms 258.20ms 516.50ms 552.84ms 689.12ms
query TestQuery {
  users {
    id
    username
    name
    reviews {
      id
      body
      product {
        inStock
        name
        price
        shippingEstimate
        upc
        weight
        reviews {
          id
          body
          author {
            id
            username
            name
            reviews {
              id
              body
              product {
                inStock
                name
                price
                shippingEstimate
                upc
                weight
              }
            }
          }
        }
      }
    }
  }
  topProducts(first: 5) {
    inStock
    name
    price
    shippingEstimate
    upc
    weight
    reviews {
      id
      body
      author {
        id
        username
        name
        reviews {
          id
          body
          product {
            inStock
            name
            price
            shippingEstimate
            upc
            weight
          }
        }
      }
    }
  }
}

Variable Batching Throughput

Req/s Err%
Constant (50 VUs) 23501.87 0.00%
Ramping (0-500-0 VUs) 18234.06 0.00%
Response Times & Query
Min Med Avg P90 P95 Max
Constant 0.10ms 1.72ms 2.08ms 3.99ms 4.88ms 44.99ms
Ramping 0.10ms 9.64ms 11.57ms 23.64ms 28.42ms 105.57ms
query TestQuery($upc: ID!, $price: Long!, $weight: Long!) {
  productByUpc(upc: $upc) {
    inStock
    shippingEstimate(weight: $weight, price: $price)
  }
}

Variables (5 sets batched per request)

[
  { "upc": "1", "price": 899, "weight": 100 },
  { "upc": "2", "price": 1299, "weight": 1000 },
  { "upc": "3", "price": 15, "weight": 20 },
  { "upc": "4", "price": 499, "weight": 100 },
  { "upc": "5", "price": 1299, "weight": 1000 }
]

Run 22193791827 • Commit c67ce3e • Thu, 19 Feb 2026 18:48:51 GMT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants