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

Improve logback startup time

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • 1.1.6
    • 1.1.5
    • logback-classic
    • None

    Description

      From Ceki's Mar 3rd, 2014 comment on the Java Bien! blog:

      As for logback start up time, I think that resolving the local host name might be responsible for the delay more than the class load time. In any case, I agree that 200 ms to load the logback config file may be somewhat excessive.

      A few details about my application:

      • Without logback on the classpath, my application starts up in ~275ms.
      • With logback on the classpath—and without any configuration files—my application starts up in ~375ms.
      • With a logback.xml configuration on the classpath, my application starts up in ~450ms.

      So logback is adding between 100 and 175 ms of startup time, depending on whether there is a logback.xml file present. I can deal with the initial extra 100ms, but once startup time reaches the ~450ms mark, it creates a very noticeable lag. This is a command-line application intended to be run many times per day by users, so startup time really matters.

      I have not profiled the application to see where the hotspots actually lie, but if the hostname lookup is indeed a major contributor to the problem, perhaps it could be made optional.

      Otherwise, anything that can be done to reduce logback startup time to a minimum would be appreciated.

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            cbeams Chris Beams
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: