Skip to content

perf(endpoints): Add peephole optimizations to endpoint resolution codegen - #7308

Draft
alextwoods wants to merge 1 commit into
alexwoo/endpoints-bdd-pr4from
alexwoo/endpoints-bdd-pr5
Draft

perf(endpoints): Add peephole optimizations to endpoint resolution codegen#7308
alextwoods wants to merge 1 commit into
alexwoo/endpoints-bdd-pr4from
alexwoo/endpoints-bdd-pr5

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-pr5 branch from 0269d85 to 01f65a8 Compare August 21, 2026 19:53
@alextwoods
alextwoods force-pushed the alexwoo/endpoints-bdd-pr5 branch 2 times, most recently from 7dd1e2d to 4353e85 Compare August 21, 2026 20:32
@alextwoods
alextwoods force-pushed the alexwoo/endpoints-bdd-pr5 branch from 4353e85 to 7970e51 Compare August 21, 2026 21:36
…degen

Add compile-time peephole optimizations to both BDD and Rules endpoint
resolver code generation that eliminate unnecessary allocations and
method dispatch overhead:

1. coalesce+substring → startsWith/endsWith/regionMatches
2. ite(cond, a, b) → inline ternary (cond ? a : b)
3. coalesce(boolExpr, default) → inline null-check
4. stringEquals → .equals() unconditionally
5. Dead null-check elimination on ite assigns
6. Endpoint.of(EndpointUrl) zero-attribute factory
7. isValidHostLabel → isValidHostLabelSingle/Multi specialization
8. StringConcatExpression parenthesization for .equals() source
@alextwoods
alextwoods force-pushed the alexwoo/endpoints-bdd-pr5 branch from 7970e51 to d05f197 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