<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:58:58 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-2098] BSONArrayBuilder::subXStart, various forms of inefficiency</title>
                <link>https://jira.mongodb.org/browse/SERVER-2098</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;BSONArrayBuilder has a few rather serious performance glitches around subarrayStart and subobjStart, specifically:&lt;/p&gt;

&lt;p&gt;These functions require that you provide a &apos;name&apos; for the element that you wish to start, as a string. As a result, you are forced into a strlen call (to populate StringData) and a strtol call (to convert the string to an integer), and to keep your own external integer counter to convert to a string. This is mostly useless: the common use case here is just to start the next element in the series, and BSONArrayBuilder already keeps an internal counter.&lt;/p&gt;

&lt;p&gt;I think you could just have:&lt;/p&gt;

&lt;p&gt;subarrayStart();  // auto-increment to next index&lt;br/&gt;
subobjStart(); // auto-increment to next index&lt;br/&gt;
subarrayStart(size_t index); // ok, you want to do something fancy, use &apos;fill&apos;, etc. Still no need for strtol&lt;br/&gt;
subobjStart(size_t index);  // as above&lt;br/&gt;
subarrayStart( const StringData&amp;amp; strIndex); // do the whole complex dance with strtol, fill, etc.&lt;br/&gt;
subobjStart( const StringData&amp;amp; strIndex); // as above.&lt;/p&gt;

&lt;p&gt;This would let most users never have to worry about this stuff at all (since they are starting array elements in order), let more advanced users use a more efficient mechanism that avoids string processing when using offsets by providing integer offsets, and finally provide a way forward for the more general case.&lt;/p&gt;

&lt;p&gt;Finally, what should the behavior be if you specifiy a &apos;name&apos; (index) for an element and you are already beyond that many elements in the array? It appears that the provided name&apos;is just ignored in this case. Perhaps that should be an error?&lt;/p&gt;</description>
                <environment></environment>
        <key id="13701">SERVER-2098</key>
            <summary>BSONArrayBuilder::subXStart, various forms of inefficiency</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="9">Done</resolution>
                                        <assignee username="mathias@mongodb.com">Mathias Stearn</assignee>
                                    <reporter username="andrew.morrow@mongodb.com">Andrew Morrow</reporter>
                        <labels>
                    </labels>
                <created>Tue, 16 Nov 2010 00:23:03 +0000</created>
                <updated>Tue, 12 Jul 2016 00:17:14 +0000</updated>
                            <resolved>Thu, 31 Mar 2011 21:34:25 +0000</resolved>
                                    <version>1.6.2</version>
                    <version>1.6.3</version>
                    <version>1.6.4</version>
                    <version>1.7.0</version>
                    <version>1.7.1</version>
                    <version>1.7.2</version>
                                    <fixVersion>1.9.0</fixVersion>
                                    <component>Internal Client</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="27533" author="acm" created="Fri, 1 Apr 2011 14:12:17 +0000"  >&lt;p&gt;Hey Mathias -&lt;/p&gt;

&lt;p&gt;That looks great. It might be a few weeks until I can get around to building&lt;br/&gt;
1.9 and benchmarking this, but I&apos;m pretty optimistic that it is a win for&lt;br/&gt;
building up an array. Thanks for getting it checked in.&lt;/p&gt;

&lt;p&gt;Andrew&lt;/p&gt;

</comment>
                            <comment id="27484" author="redbeard0531" created="Thu, 31 Mar 2011 21:34:25 +0000"  >&lt;p&gt;For now I left it ignoring numbers less than next, but at least it is doc&apos;d now.&lt;/p&gt;</comment>
                            <comment id="27483" author="auto" created="Thu, 31 Mar 2011 21:31:52 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;RedBeard0531&apos;, u&apos;name&apos;: u&apos;Mathias Stearn&apos;, u&apos;email&apos;: u&apos;mathias@10gen.com&apos;}
&lt;p&gt;Message: Better BSONArrayBuilder::sub&lt;/p&gt;
{obj,array}
&lt;p&gt;Start &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-2098&quot; title=&quot;BSONArrayBuilder::subXStart, various forms of inefficiency&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-2098&quot;&gt;&lt;del&gt;SERVER-2098&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/e59799f0790731f1615c8c369e20a66b651b58d0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/e59799f0790731f1615c8c369e20a66b651b58d0&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 31 Mar 2011 21:31:52 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        12 years, 46 weeks, 5 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_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>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            12 years, 46 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>andrew.morrow@mongodb.com</customfieldvalue>
            <customfieldvalue>auto</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|hrpbdb:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>21417</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </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|ht0fx3:</customfieldvalue>

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