[SERVER-68281] Improve ValueGuard performance Created: 25/Jul/22  Updated: 29/Oct/23  Resolved: 19/Aug/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.1.0-rc0

Type: Task Priority: Major - P3
Reporter: Ian Boros Assignee: Parker Felix
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: QE 2022-08-08, QE 2022-08-22
Participants:

 Description   

The call to releaseValue() is not inlined, (link). Also, it's very common that we dismiss a ValueGuard before it's destroyed, which means the call to releaseValue() does nothing.

We can improve this by avoiding the call to releaseValue() when the owned value is Nothing. We could extend this for all shallow types, but it would require changing the layout of TypeTags.

A test version of this change has shown a measurable improvement on some queries.



 Comments   
Comment by Githook User [ 10/Aug/22 ]

Author:

{'name': 'Parker Felix', 'email': 'parker.felix@mongodb.com', 'username': 'parker-felix'}

Message: SERVER-68281 Improve ValueGuard performance
Branch: master
https://github.com/mongodb/mongo/commit/3f2f1e82b260243c730d4d9d029a8c8268dc09a0

Generated at Thu Feb 08 06:10:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.