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

oprofile) get_log_level on a hot path

    XMLWordPrintable

Details

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

    Description

      # 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
      ...
      38        2.2170  get_log_level
      ...
      

      I see that there is...

          perform_callbacks(ON_LOG_LEVEL, NULL, NULL);
      

      ... infrastructure, which is well used here...

      //file_logger.c
          current_log_level = sapi->log->get_level();
          sapi->callback->register_callback(NULL, ON_LOG_LEVEL, on_log_level, NULL);
      // extension_logger.c
          current_log_level = sapi->log->get_level();
          sapi->callback->register_callback(NULL, ON_LOG_LEVEL,
                                            on_log_level, NULL);
      

      ... for some reason is NOT used on a hot path in Couchbase:

      void LOG(EXTENSION_LOG_LEVEL severity, const char *fmt, ...) {
      ...
              if (loggerApi->get_level() <= severity) {
      

      That would speed up Couchbase 2%, 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