Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-16390

oprofile) get_logger on a hot path

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Minor
    • 4.5.0
    • 3.0.1
    • couchbase-bucket
    • Security Level: Public
    • KV: Oct 4 - Oct 24

    Description

      [root@hostname ~]# opreport -l /opt/couchbase/bin/memcached
      CPU: Intel Westmere microarchitecture, speed 1596 MHz (estimated)
      Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (No unit mask) count 100000
      samples  %        symbol name
      ...
      86        5.0175  get_logger
      ...
      

      Logger is read every single time, on a hot path...

      void LOG(EXTENSION_LOG_LEVEL severity, const char *fmt, ...) {
          char buffer[2048];
       
          if (loggerApi != NULL) {
              EXTENSION_LOGGER_DESCRIPTOR* logger =
                  (EXTENSION_LOGGER_DESCRIPTOR*)loggerApi->get_logger();
      

      ...that does not seem reasonable.

      As far as I can see from code, "extensions.logger" changes during startup, and does not change since then at all.

      If there is any doubt to that, we could have used something similar to existing...

      sapi->callback->register_callback(NULL, ON_LOG_LEVEL, 
      perform_callbacks(ON_LOG_LEVEL, NULL, NULL);
      

      ...infrastructure.

      That would speed up Couchbase 5%, which is something very handsome for this price, what do you think?

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              trond Trond Norbye
              paf Alexander Petrossian (PAF)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty