Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-643

performance issue

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 0.9.29
    • logback-classic
    • 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.

      Attachments

        Activity

          People

            logback-dev Logback dev list
            kite Roman Kosenko
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: