Skip to content

perf: Reduce ancestry calls in isResourceMethod - #2631

Open
Postremus wants to merge 1 commit into
smallrye:mainfrom
Postremus:issues/2630-improve-isResourceMethod
Open

perf: Reduce ancestry calls in isResourceMethod#2631
Postremus wants to merge 1 commit into
smallrye:mainfrom
Postremus:issues/2630-improve-isResourceMethod

Conversation

@Postremus

@Postremus Postremus commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

ancestry determines the parent methods the given method is overriden. Which in turn are checked if they are a resource method.

However, often the resource methods are not overriding any parent methods. so the ancestry call would be wasted.

ancestry() is slow (relativly speaking) because of the interfaces() calls.

Introduce a fast path for first checking if the given method is already resource method, before falling back to checking ancestry.

This saves about 100ms when doing a quarkus:build.

Related to #2630

ancestry determines the parent methods the given method is overriden. Which in turn are checked if they are a resource method.

However, often the resource methods are not overriding any parent methods. so the ancestry call would be wasted.

ancestry() is slow (relativly speaking) because of the interfaces() calls.

Introduce a fast path for first checking if the given method is already resource method, before falling back to checking ancestry.
@Postremus
Postremus force-pushed the issues/2630-improve-isResourceMethod branch from 03d02f9 to 3a5fba9 Compare August 15, 2026 16:35
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