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.
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:
The results above are for the case when the method is not one of Object's methods.
The results above are for the case when the method is one of Object's methods.
Thanks for your analysis and contribution! We will look into your suggestions in more detail later this year before preparing the next maintenance release.
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. 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: The results above are for the case when the method is not one of Object's methods.
The results above are for the case when the method is one of Object's methods.
GetMethodBenchmark.zip