Uploaded image for project: 'Couchbase Gateway'
  1. Couchbase Gateway
  2. CBG-658

Optimize LogKey string lookup

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 2.8.0
    • None
    • SyncGateway
    • Security Level: Public
    • None
    • CBG Sprint 39
    • 3

    Description

      Generating the log key string at logging time is currently a map lookup, based on the bit mask entry. This optimizes the 'is log key enabled' lookup, but adds some overhead during the string lookup. Since the enabled check is only needed for console logging (not enabled by default), optimizing for the string lookup would be preferred.

      Switching to a slice lookup instead of map would improve the string lookup considerably, while still making the enabled check reasonable. This requires switching the log keys from their current bit shifted values to a contiguous array. The current bitmask approach supports logging to multiple keys in a single call, but that's a very uncommon use case - after switching to a contiguous array, we'll need to scan for instances of the multiple key pattern and replace (preferably with a single key logging, but with a new multi-key logging API if absolutely needed.

      Attachments

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

        Activity

          People

            adamf Adam Fraser
            adamf Adam Fraser
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty