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

Add operator<<(bool) to StringBuilderImpl

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.4.0-rc4
    • Fix Version/s: 3.4.1, 3.5.1
    • Component/s: Performance
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Backport Completed:
    • Sprint:
      Query 2016-12-12
    • Linked BF Score:
      0

      Description

      Running the "Queries.IntNonIdFindOne" mongo-perf test while profiling mongod under VTune shows the StringBuilderImpl operator<<(int) as a significant hotspot. This stems from writing boolean values to StringBuilder in the read/update/delete path during query planning. As we don't implement a boolean stream handler, booleans are handled as type int, and are written inefficiently via snprintf. A boolean operator can be written that will perform the same action in a (much) more efficient manner.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: