<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:34:19 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>[GODRIVER-487] BSON marshal/unmarshal perf has degraded significantly vs mgo</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-487</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;In Cloud Free Monitoring we&apos;re seeing very slow performance is &lt;tt&gt;bson.Marshal()&lt;/tt&gt;/&lt;tt&gt;Unmarshal()&lt;/tt&gt; (and &lt;tt&gt;mongo.Cursor.Decode()&lt;/tt&gt;).  &lt;/p&gt;

&lt;p&gt;Where our query might take 10s of millis on the DB, returning ~4000 largish documents, unmarshaling them into our model structs takes 4-5 &lt;em&gt;seconds&lt;/em&gt; - approximately 1ms per doc!  These docs are on the order of 10kb in size.&lt;/p&gt;

&lt;p&gt;We also have an area where we read larger documents (~40kb each), and these are even slower to unmarshal - on the order of 3ms/doc.&lt;/p&gt;

&lt;p&gt;Dropping &lt;tt&gt;mgo&lt;/tt&gt; into the same codebase (&lt;em&gt;just&lt;/em&gt; for BSON marshal/unmarshal - with &lt;tt&gt;mongo-go-driver&lt;/tt&gt; in-place for driver duties) saw approximately 20x improvement.&lt;/p&gt;

&lt;p&gt;Out of curiosity, I put together some benchmarks using canned structs of varying size and object depth, comparing BSON marshal/unmarshal in &lt;tt&gt;mgo&lt;/tt&gt; and &lt;tt&gt;mongo-go-driver&lt;/tt&gt;: &lt;a href=&quot;https://github.com/dunkyboy/mongo-driver-bench&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/dunkyboy/mongo-driver-bench&lt;/a&gt;.  The benchmarks corroborated our findings, showing &lt;tt&gt;mgo&lt;/tt&gt; at ~3x faster for very simple structs, and 40x+ faster for larger, more complex structs.&lt;/p&gt;

&lt;p&gt;FWIW we&apos;re planning on working around this in Cloud Free Monitoring by using &lt;tt&gt;mgo&lt;/tt&gt; purely for BSON marshal/unmarshal.  But we&apos;d much prefer to just use &lt;tt&gt;mongo-go-driver&lt;/tt&gt;, so looking forward to improvements!&lt;/p&gt;</description>
                <environment>macOS 10.13.2&lt;br/&gt;
centos 7.5.1804</environment>
        <key id="569354">GODRIVER-487</key>
            <summary>BSON marshal/unmarshal perf has degraded significantly vs mgo</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="3">Duplicate</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="duncan.armstrong@mongodb.com">Duncan Armstrong</reporter>
                        <labels>
                            <label>FreeMonitoring</label>
                    </labels>
                <created>Mon, 9 Jul 2018 16:54:52 +0000</created>
                <updated>Fri, 14 May 2021 17:21:34 +0000</updated>
                            <resolved>Mon, 30 Jul 2018 20:06:11 +0000</resolved>
                                    <version>0.0.8</version>
                                                    <component>BSON</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="1960708" author="kris.brandow" created="Mon, 30 Jul 2018 20:06:11 +0000"  >&lt;p&gt;Closing this a duplicate of &lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-494&quot; title=&quot;BSON Codec Redesign&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-494&quot;&gt;&lt;del&gt;GODRIVER-494&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="572145">GODRIVER-494</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1670215">GODRIVER-1946</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr8c47:</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>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>