WiredTigerRecordStore::seek recomputes table URI string length each time

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution
    • Fully Compatible
    • Execution Team 2024-02-05
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      https://github.com/10gen/mongo/blob/af39933b7e530cf1e582093fa06197ec6dd7799a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp#L2182

          // Implicit construction of StringData:
          metricsCollector.incrementOneCursorSeek(c->uri); 

      This line of code implicitly constructs a StringData from a const char*, which results in a call to strlen every time we seek on a record store cursor. While this is not an enormous cost, it has shown up in some profiles I've taken.

            Assignee:
            Louis Williams
            Reporter:
            Ian Boros
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: