Fast-path _extractReadConcern for the common case

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Summary

      _extractReadConcern runs ~120 lines of branching logic on every operation to determine which read concern to use.

      If the most common case is to use the implicit default (local), we should have a fast path for it.
      A fast-path early return for this common case eliminates a mutex-protected ReadThroughCache lookup, and nested conditionals.

      Profiling YCSB 100 read shows 0.85% of CPU in this path, dominated by mutex contention on the cache.

      Proposed Fix

      Add a cheap atomic boolean and accessor in read_write_concern_defaults.h and a fast-path early return at top of _extractReadConcern:

      See this patch for proposed change. 

      Impact

      This multipatch shows a 1.3% improvement in our 100 read YCSB workload.

       

            Assignee:
            Unassigned
            Reporter:
            Jawwad Asghar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: