[SERVER-27176] Improve performance of command writeConcern parsing Created: 23/Nov/16 Updated: 05/Apr/17 Resolved: 06/Dec/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying, Replication |
| Affects Version/s: | None |
| Fix Version/s: | 3.4.1, 3.5.1 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | James Wahlin | Assignee: | James Wahlin |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Backport Completed: | |||||||||||||
| Sprint: | Query 2016-12-12 | ||||||||||||
| Participants: | |||||||||||||
| Linked BF Score: | 0 | ||||||||||||
| Description |
|
When a command is executed we attempt to extract a "writeConcern" field via extractWriteConcern() call which calls bsonExtractTypedField() to parse write concern from the command object (see here and here). In the case where the command does not contain a "writeConcern" field (which is valid), an error Status object is generated by bsonExtractField() and creates an error message using str::stream, which is an expensive operation. This came up as a bottleneck when profiling the Queries.IntNonIdFindOne mongo-perf test, with 8 threads and the --readCmd=true flag. This test performs an indexed findOne(). The extractWriteConcern() call consumed roughly 2% of the command run time. A few thoughts on fixing:
|
| Comments |
| Comment by Githook User [ 06/Dec/16 ] |
|
Author: {u'username': u'jameswahlin', u'name': u'James Wahlin', u'email': u'james.wahlin@10gen.com'}Message: (cherry picked from commit 62245660d4567096c184befc08267b77c9e3a3bb) |
| Comment by Githook User [ 06/Dec/16 ] |
|
Author: {u'username': u'jameswahlin', u'name': u'James Wahlin', u'email': u'james.wahlin@10gen.com'}Message: |