[JAVA-2138] Performance regression between OP_QUERY and find command Created: 03/Mar/16  Updated: 20/Dec/19  Resolved: 20/Dec/19

Status: Closed
Project: Java Driver
Component/s: Performance, Query Operations
Affects Version/s: 3.2.0
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
backports JAVA-3077 Java driver upgrade causing slowness ... Closed
Depends
Related

 Description   

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.

Generated at Thu Feb 08 08:56:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.