[SERVER-9757] Returning an OK mongo::Status should be a trivial operation Created: 22/May/13 Updated: 11/Jul/16 Resolved: 23/May/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.5.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Andrew Morrow (Inactive) | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL |
| Participants: |
| Description |
|
Currently, a function that returns "Status::OK" is not efficiently generated, since the call to construct the OK status is not inlined (see getOKInfo). Furthermore, since getOKInfo uses a function scoped static, the code generated for getOKInfo is suboptimal. We should refactor Status so that its lifecycle methods are inlined, and so that we no longer require the function scoped static (and related static initializer). The easiest way to do this is to make a Status containing a null pointer mean 'OK', and only populate the error pointer if there is actual error state to return. |
| Comments |
| Comment by auto [ 22/May/13 ] |
|
Author: {u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@10gen.com'}Message: |
| Comment by auto [ 22/May/13 ] |
|
Author: {u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@10gen.com'}Message:
|
| Comment by auto [ 22/May/13 ] |
|
Author: {u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@10gen.com'}Message: |
| Comment by Andrew Morrow (Inactive) [ 22/May/13 ] |
|
Please see the comments in http://codereview.10gen.com/10590022 for details on the performance improvements queued to resolve this ticket. |