Every joint point used for interception and logging methods causes several Java Reflection calls. It has some impact on performance.
The purpose of these Java Reflection calls is to get the signature of the method, names and types of its parameters, the effective
@GetIt annotation and parameters.
The thing is that the data stays unchanged from one call to another.
So the idea for the performance improvements was to collect all the method signature related data
EasyLogSignature at the first call and create some kind of method signature map
ConcurrentMap<String, EasyLogSignature>. That map should contain all the information about all method that should be logged in the application. If the method is never called/logged then the map entry for it is never created and never added to the map.
Then when the method is invoked next time there is no need to make those heavy Java Reflection calls.
Note: Since we use
ConcurrentHashMap (an imlpementation of
ConcurrentMap) it’s thread safe
You may also find these posts interesting: