Details
-
Improvement
-
Resolution: Unresolved
-
Major
-
None
-
0.9.29
-
None
Description
In the ch.qos.logback.classic.Logger there is a comment related to filterAndLog_0_Or3Plus, filterAndLog_1, filterAndLog_2:
/**
- The next methods are not merged into one because of the time we gain by not
- creating a new Object[] with the params. This reduces the cost of not
- logging by about 20 nanoseconds.
*/
But if we use at least one "TurboFilter" then "new Object[]" is called twice in filterAndLog_1 & filterAndLog_2 (because of LoggerContext.getTurboFilterChainDecision_1 & LoggerContext.getTurboFilterChainDecision_2). So in this case you don't receive advantage of splitting, even more - merged version will be faster.
And methods LoggerContext.getTurboFilterChainDecision_0_3OrMore, LoggerContext.getTurboFilterChainDecision_1, LoggerContext.getTurboFilterChainDecision_2 can be merged in one without any performance penalty.