[SERVER-1271] BSONObjBuilder and BSONArrayBuilder chould have a 'done' method that does not return a BSONObj Created: 21/Jun/10 Updated: 12/Jul/16 Resolved: 27/Jul/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Client |
| Affects Version/s: | 1.5.3 |
| Fix Version/s: | 1.5.7 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Andrew Morrow (Inactive) | Assignee: | Alberto Lerner |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
All |
||
| Participants: |
| Description |
|
Its frequently the case that you construct a subobject for which you have no interest in the resulting BSONObj, since you only care about the BSONObj for the top level. It would be nice if there was a way to get the "done" behavior, but not spend time constructing a BSONObj just to throw it away. FWIW, the call to BSONObj::init that results from a call to 'done' is not inlined in my build: { generates the following on my machine (compiled with optimization of course): 202310: 53 push %rbx There is no need for that call to BSONObj::init (inlined or not, not to mention any other construction / destruction code) in this use case. |
| Comments |
| Comment by Alberto Lerner [ 27/Jul/10 ] |
|
Thanks Andrew Morrow for pointing out the issue and contributing the fix! |
| Comment by Alberto Lerner [ 27/Jul/10 ] |
|
Author: {'login': 'acm', 'name': 'Andrew Morrow', 'email': 'andrew.c.morrow@gmail.com'}fast done capability for BSONObjBuilder |