[SERVER-55835] BSONIteratorSorted should reuse calculated fieldName size Created: 06/Apr/21 Updated: 29/Oct/23 Resolved: 08/Apr/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.0.0-rc0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Henrik Edin | Assignee: | Henrik Edin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Sprint: | Execution Team 2021-04-19 | ||||||||
| Participants: | |||||||||
| Description |
|
BSONIteratorSorted traverses the provided BSONObj to collect all field names. But when storing it just uses char*. This leads to the comparator having to re-calculate the field name size over and over again during the sorting stage. Later when a user is extracting BSONElements in sorted order the field name sizes are calculated yet again. We should be able to just calculate it once and then reuse. |
| Comments |
| Comment by Githook User [ 08/Apr/21 ] |
|
Author: {'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}Message: |