[SERVER-36475] Reduce use of stringstream in BSONObj.jsonString Created: 06/Aug/18 Updated: 29/Oct/23 Resolved: 08/Aug/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Performance |
| Affects Version/s: | None |
| Fix Version/s: | 4.1.2 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Kashish Garg | Assignee: | Kashish Garg |
| 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: | Platforms 2018-08-13 | ||||||||
| Participants: | |||||||||
| Description |
|
Right now, in order to convert a BSON Object into a JSON string, we recursively call the jsonString() function, which creates a new stringstream for every call. Creating a new stringstream every time is quite expensive. We should only create it once and pass it in as an argument for the successive recursive calls to help improve auditing performance. |
| Comments |
| Comment by Githook User [ 08/Aug/18 ] |
|
Author: {'name': 'Kashish Garg', 'email': 'kashish.garg@mongodb.com'}Message: |