Uploaded image for project: 'SLF4J'
  1. SLF4J
  2. SLF4J-471

CharSequence and varargs

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • 2.0.14
    • None
    • Core API
    • None

    Description

      Could sl4fj provide an interface that enables avoiding all object allocation?

      This is important for low latency applications, which only allocate objects at startup, in order to prevent even minor collection pauses.

      The actual zero-garbage implementation could come later. It would be nice if the slf4j api itself did not have any such impediments. So e.g. users could pass some preallocated string-like object which implements CharSequence, instead of a concrete String, which cannot be allocated ahead of time. There could also be overloaded methods for relatively few parameters (say up to ten), for users that want to avoid the array allocation involved in the java variable argument feature. Of course it'd be positive to have logback implementation so that those actually work, even if they initially work with allocations.

      For the sake of backwards compatibility, this could be a new java interface. Perhaps a superinterface with the varargs replacements as default methods, to avoid breaking anybody who might be implementing the original interface.

      Attachments

        Activity

          People

            slf4j-dev SLF4J developers list
            foofar Foo Far
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: