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

Address slowness in Explain::getPlanSummary

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.4.2, 3.5.2
    • Component/s: None
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Query 2017-01-23
    • Linked BF Score:
      0

      Description

      While profiling mongod under VTune, running the Queries.IntNonIdFindOn mongo-perf test with 8 threads I found that roughly 6% of the FindCmd run time is spent in Explain::getPlanSummary, generating a plan summary string. Of this 6%, 2/3rds is spent in StringBuilderImpl::appendDoubleNice(), converting index direction (in this case the number 1) from double to string.

      We should look to optimize this path, either with StringBuilder optimization or custom parsing in getPlanSummary.

      It is worth noting that changing the createIndex call in "Queries.IntNonIdFindOn" to pass a NumberInt(1) rather than the default of double reduces the cost by 50%. The remaining 50% is spent in StringBuilderImpl operator<<(int) which could be optimized for small integers as was done in our itoa() implementation.

      See attachment for VTune screenshot

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: