Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-2138

Performance regression between OP_QUERY and find command

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.2.0
    • None

      The 3.2 driver introduce support for the find and getMore commands added to the 3.2 server. The driver uses these commands instead of OP_QUERY and OP_GET_MORE when it's connected to a 3.2 server or newer.

      However, benchmarks show that the 3.2 driver performance for queries has degraded when using the new code path. Instrumentation of the driver shows that the degradation can be attributed partially to the server and partially to the driver.

      The working hypothesis is that there is more overhead handling find command reply messages than normal OP_REPLY messages. In particular:

      • failure detection is less efficient, as the driver has to search for the ok field in the command reply instead of checking a bit in the wire protocol
      • response document decoding is less efficient, as the driver has to decode response documents contained in a BSON array instead of packed BSON documents at the end of the OP_REPLY.

            Assignee:
            Unassigned Unassigned
            Reporter:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: