Skip to content

Conversation

@ratacolita
Copy link

assertIsNotOnBaseObject currently depends on throwing exception for its base case, that is, when the method is not one of Object's methods.
That is very bad for performance because exceptions are slow in Java when they need to fill the stack trace.
image
The image shows a flame graph from a application running DRW.
A lot of time is spent on NoSuchMethodException initialization.

I have done a micro benchmark of current implementation versus this proposed implementation:
image
The results above are for the case when the method is not one of Object's methods.

image
The results above are for the case when the method is one of Object's methods.

GetMethodBenchmark.zip

@mikewse
Copy link
Contributor

mikewse commented Aug 26, 2020

Thanks for your analysis and contribution! We will look into your suggestions in more detail later this year before preparing the next maintenance release.

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.

2 participants