[SERVER-62980] Revert Perf Regression in BSON compareElementStringValues Created: 25/Jan/22 Updated: 29/Oct/23 Resolved: 26/Jan/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.3.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Matt Kneiser | Assignee: | Matt Kneiser |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Operating System: | ALL | ||||
| Sprint: | Execution Team 2022-02-07 | ||||
| Participants: | |||||
| Linked BF Score: | 129 | ||||
| Description |
|
SERVER-27209 introduced a large change taking BSONElement::valuestr() private as a means of deprecating its use outside of BSONElement. BackgroundSince compareElementStringValues() is a bare function (i.e. external to BSONElement), I looked to simplify the logic when removing its use of the privatized valuestr(). That refactor introduced a low-level difference between how to compute the int return value of StringData::compare() vs. compareElementStringValues(). Basically boiling down to forcing one-ness in the return value of a string compare. This led to a ~10% perf regression in a sensitive test for a customer noted here: HELP-23789 SolutionI pasted the logic of BSONElement::valuestr() into compareElementStringValues(). While this may take a hit on readability, it achieves a simple replacement with no meaningful perf impact. |
| Comments |
| Comment by Matt Kneiser [ 26/Jan/22 ] |
|
Fixes Hot BF: https://jira.mongodb.org/browse/BF-24070 |
| Comment by Githook User [ 26/Jan/22 ] |
|
Author: {'name': 'Matt Kneiser', 'email': 'matt.kneiser@mongodb.com', 'username': 'themattman'}Message: |