Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-85158

Audit and remove use of const StringData& and add a lint rule

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • Service Arch
    • Service Arch Prioritized List

    Description

      The code base currently contains many uses of const StringData&, in particular as a function argument. StringData should almost always be passed by value; it is already a view type and is cheap to copy. Passing by value eliminates additional pointer indirections required to pass by reference, and enables the compiler to optimize the code more aggressively.

      We should remove all the usages we can of passing by reference and add a lint or static analysis rule to catch it in the future.

      Attachments

        Activity

          People

            backlog-server-servicearch Backlog - Service Architecture
            george.wangensteen@mongodb.com George Wangensteen
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: