Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeSafeMatching.getArgumentType causes slowdowns due to Class.getMethods copying #2728

Closed
j-baker opened this issue Aug 13, 2022 · 1 comment

Comments

@j-baker
Copy link
Contributor

j-baker commented Aug 13, 2022

Originally reported in #2720, splitting out for fix in separate PR.

The second slowdown that seemed to be affecting me comes from TypeSafeMatching.getArgumentType. This iterates through all of the methods on the argument matcher class to find the appropriate matches method, seemingly also for each method call. By performing this operation, a lot of JVM internal datastructures get copied - it calls Class.getMethods, which copies all the > methods on the class. This method could probably be cached on a per-class basis.

@TimvdLippe
Copy link
Contributor

#2729 fixed this, but referenced the wrong issue number.

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

No branches or pull requests

2 participants