Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-468

Wrap any log calls in Memcached/HotRod servers around if enabled calls

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • Major
    • 4.1.0.BETA2
    • 4.1.0.BETA2
    • Remote Protocols
    • None

    Description

      While profiling Hot Rod, I keep seeing time being spend in these:

      2.3% - 25,569 ms - 140,862 inv. scala.LowPriorityImplicits.genericWrapArray (line\: 56)
      ...
      2.2% - 24,713 ms - 140,862 inv. scala.LowPriorityImplicits.genericWrapArray (line\: 231)

      These appear to come from trying to create arrays when for log messages, i.e.:
      trace("Decoded header

      {0}

      ", header)

      trace method definition:
      def trace(msg: => String, params: Any*) = if (log.isTraceEnabled) log.trace(msg, params.map(_.asInstanceOf[AnyRef]) : _*)

      So, change all trace calls to be protected by "if (log.isTraceEnabled)" to avoid wasteful creation of arrays.

      Attachments

        Activity

          People

            rh-ee-galder Galder ZamarreƱo
            rh-ee-galder Galder ZamarreƱo
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: