Add early return guard in TrafficRecorder::observe() before BSON serialization

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Summary

      TrafficRecorder::observe() builds a BSON representation of the transport session (ts.toBSON().toString()) on every operation before checking whether recording is enabled. When traffic recording is disabled (the default), this serialization work is wasted.

      Profiling shows 1.3% of CPU spent in this path on a Graviton instance running YCSB 100 read.

      Proposed Fix

      Add an early return check of _shouldRecord in observe() before the expensive serialization:

      See this patch for change. 

      Impac

      This multipatch showed a 2.89% improvment in YCSB 100 read with the proposed change.

            Assignee:
            Peter Volk
            Reporter:
            Jawwad Asghar
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: