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

Address slowness in Explain::getPlanSummary

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 3.4.2, 3.5.2
    • None
    • None
    • Fully Compatible
    • Query 2017-01-23
    • 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

              james.wahlin@mongodb.com James Wahlin
              james.wahlin@mongodb.com James Wahlin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: