Skip to content

Removed redundant regex capturing groups#9100

Merged
glen-84 merged 1 commit intomainfrom
gai/remove-redundant-capturing-groups
Feb 9, 2026
Merged

Removed redundant regex capturing groups#9100
glen-84 merged 1 commit intomainfrom
gai/remove-redundant-capturing-groups

Conversation

@glen-84
Copy link
Copy Markdown
Member

@glen-84 glen-84 commented Feb 9, 2026

Summary of the changes (Less than 80 chars)

  • Removed redundant regex capturing groups.

Copilot AI review requested due to automatic review settings February 9, 2026 07:38
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 PR simplifies several regular expressions by removing redundant outer capturing groups, keeping matching behavior the same while slightly reducing regex overhead and avoiding unused group captures.

Changes:

  • Removed unnecessary outer capturing groups from whitespace normalization regexes.
  • Removed unnecessary outer capturing groups from several scalar validation regex patterns (RGB/RGBA/IP).

Reviewed changes

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

Show a summary per file
File Description
src/HotChocolate/Core/src/Types/Types/Descriptors/Conventions/XmlDocumentationProvider.cs Simplifies whitespace-detection regex by removing an unused capturing group.
src/HotChocolate/Core/src/Types.Scalars/RgbaType.cs Removes redundant outer capturing group from RGBA validation pattern.
src/HotChocolate/Core/src/Types.Scalars/RgbType.cs Removes redundant outer capturing group from RGB validation pattern.
src/HotChocolate/Core/src/Types.Scalars/IPv6Type.cs Removes redundant outer capturing group from IPv6 validation pattern while preserving anchors.
src/HotChocolate/Core/src/Types.Scalars/IPv4Type.cs Removes redundant outer capturing group from IPv4 validation pattern while preserving anchors.
src/HotChocolate/Core/src/Types.Analyzers/Helpers/GeneratorUtils.cs Simplifies whitespace-detection regex by removing an unused capturing group.

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 9, 2026

🚀 Fusion Gateway Performance Results

Simple Composite Query

Constant Load (50 VUs)

Requests/sec Error Rate
25130.55 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.09ms 1.61ms 41.03ms 1.94ms 3.65ms 4.52ms

Ramping Load (0→50→500→50 VUs)

Requests/sec Error Rate
19507.33 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.09ms 8.64ms 106.66ms 10.79ms 22.46ms 27.04ms

Executed Query

fragment User on User {
  id
  username
  name
}

fragment Review on Review {
  id
  body
}

fragment Product on Product {
  inStock
  name
  price
  shippingEstimate
  upc
  weight
}

query TestQuery {
  topProducts(first: 5) {
    ...Product
    reviews {
      ...Review
      author {
        ...User
      }
    }
  }
}

Deep Recursion Query

Constant Load (50 VUs)

Requests/sec Error Rate
24215.51 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.09ms 1.67ms 47.10ms 2.02ms 3.84ms 4.71ms

Ramping Load (0→50→500→50 VUs)

Requests/sec Error Rate
19193.91 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.09ms 8.75ms 94.83ms 10.91ms 22.76ms 27.42ms

Executed Query

fragment User on User {
  id
  username
  name
}

fragment Review on Review {
  id
  body
}

fragment Product on Product {
  inStock
  name
  price
  shippingEstimate
  upc
  weight
}

query TestQuery {
  users {
    ...User
    reviews {
      ...Review
      product {
        ...Product
        reviews {
          ...Review
          author {
            ...User
            reviews {
              ...Review
              product {
                ...Product
              }
            }
          }
        }
      }
    }
  }
  topProducts(first: 5) {
    ...Product
    reviews {
      ...Review
      author {
        ...User
        reviews {
          ...Review
          product {
            ...Product
          }
        }
      }
    }
  }
}

Variable Batching Throughput

Constant Load (50 VUs)

Requests/sec Error Rate
27593.40 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.08ms 1.46ms 46.14ms 1.77ms 3.35ms 4.11ms

Ramping Load (0→50→500→50 VUs)

Requests/sec Error Rate
21621.45 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.08ms 7.24ms 103.08ms 9.55ms 20.25ms 24.71ms

Executed Query

query TestQuery_8f7a46ce_2(
  $__fusion_1_upc: ID!
  $__fusion_2_price: Long!
  $__fusion_2_weight: Long!
) {
  productByUpc(upc: $__fusion_1_upc) {
    inStock
    shippingEstimate(weight: $__fusion_2_weight, price: $__fusion_2_price)
  }
}

Variables (5 sets batched in single request)

[
  { "__fusion_1_upc": "1", "__fusion_2_price": 899, "__fusion_2_weight": 100 },
  { "__fusion_1_upc": "2", "__fusion_2_price": 1299, "__fusion_2_weight": 1000 },
  { "__fusion_1_upc": "3", "__fusion_2_price": 15, "__fusion_2_weight": 20 },
  { "__fusion_1_upc": "4", "__fusion_2_price": 499, "__fusion_2_weight": 100 },
  { "__fusion_1_upc": "5", "__fusion_2_price": 1299, "__fusion_2_weight": 1000 }
]

No baseline data available for comparison.


Run 21816382582 • Commit 4ab4ba7 • Mon, 09 Feb 2026 07:56:27 GMT

@glen-84 glen-84 merged commit 8ac7e7e into main Feb 9, 2026
100 of 123 checks passed
@glen-84 glen-84 deleted the gai/remove-redundant-capturing-groups branch February 9, 2026 08:00
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