<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:47:35 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-81848] Make decoration construction eager again</title>
                <link>https://jira.mongodb.org/browse/SERVER-81848</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Based on my testing, the change to make some decorations use LazyInit slowed down operations rather than making them faster. I think this is caused by a few things: &lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;The only things that were made lazy were things that are relatively cheap to value-construct such as &lt;tt&gt;unique_ptr&lt;/tt&gt; (setting a single pointer to null), &lt;tt&gt;optional&lt;/tt&gt; (setting a single bool to false), &lt;tt&gt;BSONObj&lt;/tt&gt; (setting one pointer to null and another to a fixed value), etc. These types are also cheap to destroy when left in their freshly constructed state, generally just being a check for null/zero/false and returning since it will be.&lt;/li&gt;
	&lt;li&gt;While it made construction cheaper, it also made access more expensive by both adding an extra indirection in the critical path to get the offset into the buffer rather than storing it in the &lt;tt&gt;Decoration&lt;/tt&gt; object (this didn&apos;t seem to be required by the change, as far as I can tell) and adding an extra acquire-load to check if the data is initialized (which requires fencing on arm, and prior to gcc-13/clang-16 is silently upgraded to seq-cst). T&lt;/li&gt;
	&lt;li&gt;This added expense is distributed throughout the code so it is harder to find and address vs it being centralized when making the OperationContext&lt;/li&gt;
	&lt;li&gt;We also made decoration on long-lived objects like the &lt;tt&gt;ServiceContext&lt;/tt&gt; lazy, even though we would much rather pay any cost up for them front than on every access. &lt;tt&gt;Client&lt;/tt&gt; may be a bit fuzzier, but I would consider it long-lived for this purpose as well.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Given the above, I think it is best to simply revert &lt;a href=&quot;https://github.com/mongodb/mongo/commit/586d02e42a9d10bb43769b62e736fe67d6dc44ca&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this commit&lt;/a&gt; and return to eager initializing. I think rather than trying to automatically lazify construction of many decorations, it makes more sense to selectively target specific Decorations that are rarely used and expensive to construct. This would also let use choose whether they need to be thread-safe or not and just use a &lt;tt&gt;boost::optional&lt;/tt&gt; if they don&apos;t. I don&apos;t have any specific suggestions for Decorations to lazify since once that commit is reverted, constructing the decorations on OperationContext doesn&apos;t seem to be expensive enough to worry about (constructing the LockState and RecoveryUnit are, but they aren&apos;t decorations).&lt;/p&gt;


&lt;p&gt;While in that code, there are a few other changes that may make sense, but I think they are less critical.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Given that we are already zero-filling the whole buffer, we could use default-init (&lt;tt&gt;new (p) T;&lt;/tt&gt;) rather than value-init (&lt;tt&gt;new (p) T{};&lt;/tt&gt;) in &lt;a href=&quot;https://github.com/mongodb/mongo/blob/42b0d920a6ffe5a7eeea5c53e3fa145d9468f422/src/mongo/util/decorable.h#L293&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;getConstructorFn()&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;We can assume that zero-init is good enough for some types that aren&apos;t trivial init, such as &lt;tt&gt;boost::optional&lt;/tt&gt; (safer since we control the definition) and &lt;tt&gt;std::unique_ptr&amp;lt;T&amp;gt;&lt;/tt&gt; with no custom deleter (slightly more risky since the definition is provided by the toolchain, however it is hard to imagine a practical implementation where zero filling isn&apos;t correct, and our tests would explode if it wasn&apos;t)&lt;/li&gt;
	&lt;li&gt;Do something about &lt;tt&gt;CurOpStack&lt;/tt&gt;. On arm64 is acounts for 3456 bytes out of the 5752 bytes (60%!) in OperationContext&apos;s decoration buffer. Given that we zero init the whole thing we are paying for all of that all the time. We should verify if it is all needed all the time, or if it would be better to move some of it out of line.&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
        <key id="2458965">SERVER-81848</key>
            <summary>Make decoration construction eager again</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="13201">Fixed</resolution>
                                        <assignee username="alex.li@mongodb.com">Alex Li</assignee>
                                    <reporter username="mathias@mongodb.com">Mathias Stearn</reporter>
                        <labels>
                            <label>perf-8.0</label>
                            <label>perf-tiger</label>
                            <label>perf-tiger-handoff</label>
                            <label>perf-tiger-poc</label>
                            <label>perf-tiger-q4</label>
                            <label>perf-tiger-triaged</label>
                    </labels>
                <created>Wed, 4 Oct 2023 12:27:20 +0000</created>
                <updated>Thu, 1 Feb 2024 21:38:13 +0000</updated>
                            <resolved>Mon, 29 Jan 2024 17:09:00 +0000</resolved>
                                                    <fixVersion>8.0.0-rc0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>11</watches>
                                                                                                                <comments>
                            <comment id="6049441" author="xgen-internal-githook" created="Mon, 29 Jan 2024 16:07:20 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Alex Li&apos;, &apos;email&apos;: &apos;98560274+lia394126@users.noreply.github.com&apos;, &apos;username&apos;: &apos;lia394126&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-81848&quot; title=&quot;Make decoration construction eager again&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-81848&quot;&gt;&lt;del&gt;SERVER-81848&lt;/del&gt;&lt;/a&gt; Make decoration construction eager again (#18291)&lt;/p&gt;

&lt;p&gt;GitOrigin-RevId: 673a33a72e8a6b7ac7ee4e9cfc939f9b322d8fbc&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/e81f7184a8328deee339d3c0ea3b9517c7a52c2c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/e81f7184a8328deee339d3c0ea3b9517c7a52c2c&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10520">
                    <name>Problem/Incident</name>
                                                                <inwardlinks description="is caused by">
                                        <issuelink>
            <issuekey id="2359198">SERVER-77825</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="2548103">SERVER-85325</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2559115">SERVER-85835</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2559098">SERVER-85828</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25132"><![CDATA[Service Arch]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 8 Nov 2023 18:56:54 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 week, 2 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_17050" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Downstream Team Attention</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16941"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>patrick.freed@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            1 week, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>alex.li@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>mathias@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i2teyf:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i2bbys:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_22250" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Special Downgrade Instructions Required</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="23343"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="7935">Service Arch 2023-11-27</customfieldvalue>
    <customfieldvalue id="7936">Service Arch 2023-12-11</customfieldvalue>
    <customfieldvalue id="7937">Service Arch 2023-12-25</customfieldvalue>
    <customfieldvalue id="8038">Service Arch 2024-01-08</customfieldvalue>
    <customfieldvalue id="8039">Service Arch 2024-01-22</customfieldvalue>
    <customfieldvalue id="8040">Service Arch 2024-02-05</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i2t13r:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>