Skip to content

perf(endpoints): Reduce allocation in endpoint resolution - #7304

Draft
alextwoods wants to merge 1 commit into
alexwoo/endpoints-bdd-pr2from
alexwoo/endpoints-bdd-pr3
Draft

perf(endpoints): Reduce allocation in endpoint resolution#7304
alextwoods wants to merge 1 commit into
alexwoo/endpoints-bdd-pr2from
alexwoo/endpoints-bdd-pr3

Conversation

@alextwoods

Copy link
Copy Markdown
Contributor

Motivation and Context

Modifications

Testing

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

@alextwoods
alextwoods force-pushed the alexwoo/endpoints-bdd-pr3 branch from 6c232f4 to 0eb43e4 Compare August 21, 2026 19:47
@alextwoods
alextwoods force-pushed the alexwoo/endpoints-bdd-pr3 branch from 0eb43e4 to 4672665 Compare August 21, 2026 19:53
@alextwoods
alextwoods force-pushed the alexwoo/endpoints-bdd-pr3 branch 2 times, most recently from 79e3803 to 51d8552 Compare August 21, 2026 20:32
@alextwoods
alextwoods force-pushed the alexwoo/endpoints-bdd-pr3 branch from 51d8552 to 1269742 Compare August 21, 2026 21:36
Apply the same direct-return pattern as the BDD codegen to the
rules-based endpoint resolver code generation:

- Rule methods return Endpoint directly (null = carry-on) instead of
  wrapping in RuleResult — eliminates new RuleResult(endpoint) on
  every successful resolution
- Error results throw SdkClientException directly instead of
  allocating RuleResult.error() — no allocation on the error path
- Null-checks replace RuleResult.isResolved() — simpler control flow
- resolveEndpoint uses try/catch for error handling matching the BDD
  pattern
- Region param extracted once at the top of resolveEndpoint to avoid
  repeated .id() calls

Also refactors SymbolTable to use a single regionParamName (String)
instead of a Set, matching the single-region-param reality of all
current services, and adds coalesce type resolution to
AssignTypesVisitor.
@alextwoods
alextwoods force-pushed the alexwoo/endpoints-bdd-pr3 branch from 1269742 to e745bc1 Compare August 21, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant