<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:52:27 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>[JAVA-505] Performance regression due to increased memory allocation</title>
                <link>https://jira.mongodb.org/browse/JAVA-505</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;use MongoPerfTest.java to reproduce&lt;/p&gt;

&lt;p&gt;antoine@agAntec:~/tengen/support$ java -cp &quot;mongo_2-6-5.jar:.&quot; MongoPerfTest &lt;br/&gt;
insert: 17945ms&lt;br/&gt;
find: 4804ms&lt;br/&gt;
antoine@agAntec:~/tengen/support$ java -cp &quot;mongo_2-7-0.jar:.&quot; MongoPerfTest &lt;br/&gt;
insert: 18852ms&lt;br/&gt;
find: 6587ms&lt;/p&gt;

&lt;p&gt;inserts are marginally slower (about 5%) but queries are 37.5% slower.&lt;br/&gt;
It seems to have introduced by following commit:&lt;/p&gt;

&lt;p&gt;commit 66c54120c56f9329b392264ec5efba0b2a292217&lt;br/&gt;
Author: Brendan W. McAdams &amp;lt;brendan@10gen.com&amp;gt;&lt;br/&gt;
Date:   Fri Aug 19 16:05:22 2011 -0400&lt;/p&gt;

&lt;p&gt;    &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-421&quot; title=&quot;LazyBSONObject exhibits certain behavioral breakages such as improper UTF8 String Parsing&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-421&quot;&gt;&lt;del&gt;JAVA-421&lt;/del&gt;&lt;/a&gt; - LazyBSONObject exhibits certain behavioral breakages&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Fully functioning implemented LazyBSONObject, fixed string decodes&lt;/li&gt;
	&lt;li&gt;Test class now validates all known decodable types for correctness&lt;/li&gt;
	&lt;li&gt;Now works correctly, fixes known issues.&lt;/li&gt;
	&lt;li&gt;For performance, sanity and memory usage replaced all arraycopy calls&lt;br/&gt;
      with ByteBuffer usage which should help overall longterm behavior&lt;/li&gt;
&lt;/ul&gt;

</description>
                <environment></environment>
        <key id="28235">JAVA-505</key>
            <summary>Performance regression due to increased memory allocation</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</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="jeff.yemin@mongodb.com">Jeffrey Yemin</assignee>
                                    <reporter username="antoine">Antoine Girbal</reporter>
                        <labels>
                    </labels>
                <created>Fri, 13 Jan 2012 02:57:24 +0000</created>
                <updated>Mon, 18 Jun 2012 19:30:07 +0000</updated>
                            <resolved>Mon, 30 Jan 2012 22:24:45 +0000</resolved>
                                    <version>2.7.2</version>
                                    <fixVersion>2.7.3</fixVersion>
                                                        <votes>1</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="81308" author="auto" created="Fri, 20 Jan 2012 18:49:20 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;jyemin&apos;, u&apos;name&apos;: u&apos;Jeff Yemin&apos;, u&apos;email&apos;: u&apos;jeff.yemin@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-505&quot; title=&quot;Performance regression due to increased memory allocation&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-505&quot;&gt;&lt;del&gt;JAVA-505&lt;/del&gt;&lt;/a&gt;: Made encoder creation work just like decoder creation&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/88b3406f2fc841b22ec2aa4208942b64876d20f1&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/88b3406f2fc841b22ec2aa4208942b64876d20f1&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="81307" author="auto" created="Fri, 20 Jan 2012 18:49:19 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;jyemin&apos;, u&apos;name&apos;: u&apos;Jeff Yemin&apos;, u&apos;email&apos;: u&apos;jeff.yemin@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-505&quot; title=&quot;Performance regression due to increased memory allocation&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-505&quot;&gt;&lt;del&gt;JAVA-505&lt;/del&gt;&lt;/a&gt;: using cached DBDecoder in most cases to avoid excessive memory allocation caused by too many instances of DefaultDBDecoder being created&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/807c797be4212c7dbbff891aa177843edc6c5ab1&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/807c797be4212c7dbbff891aa177843edc6c5ab1&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="81125" author="jeff.yemin" created="Thu, 19 Jan 2012 22:23:55 +0000"  >&lt;p&gt;To keep things dead simple for a patch release, I&apos;m not going to add any pooling of custom decoders just yet.&lt;/p&gt;</comment>
                            <comment id="81104" author="jeff.yemin" created="Thu, 19 Jan 2012 21:42:34 +0000"  >&lt;p&gt;The previous behavior was to cache an instance of the decoder with each instance of DBPort (which are themselves cached in the connection pool).  It can&apos;t be a singleton because DefaultDBDecoder is not thread-safe.&lt;/p&gt;</comment>
                            <comment id="81089" author="leothekim" created="Thu, 19 Jan 2012 21:05:12 +0000"  >&lt;p&gt;Can the DefaultDBDecoder.FACTORY return a DefaultDBDecoder singleton?&lt;/p&gt;</comment>
                            <comment id="81074" author="antoine" created="Thu, 19 Jan 2012 20:29:46 +0000"  >&lt;p&gt;right ideally if using the default decoder, there should be 1 global.&lt;br/&gt;
That&apos;s the way it was..&lt;br/&gt;
Only if using a custom decoder would we need one per call (though could be pooled)&lt;/p&gt;</comment>
                            <comment id="81038" author="jeff.yemin" created="Thu, 19 Jan 2012 18:59:16 +0000"  >&lt;p&gt;Commit 66c54120c56f9329b392264ec5efba0b2a292217 (fix for &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-421&quot; title=&quot;LazyBSONObject exhibits certain behavioral breakages such as improper UTF8 String Parsing&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-421&quot;&gt;&lt;del&gt;JAVA-421&lt;/del&gt;&lt;/a&gt;) is half the problem.  The performance regression in that commit is that several large buffers are instantiated every time an instance of BSONInput is instantiated (two 1k byte arrays, one 16k byte array, and 1 16k char array).  In practice an instance of BSONInput is instantiated every time a document is decoded.  It&apos;s easy to roll back that change such that the arrays are again instantiated in BasicBSONDecoder.  That part is done.&lt;/p&gt;

&lt;p&gt;But after rolling back this change, there&apos;s a second half of the problem, in commit 673beed75fc347054328afaa2841d43410ee0f28.  In the commit, the driver is creating many more decoders.  Instead of creating one per DBPort, it&apos;s creating one per call/say.  This is a lot more work for the garbage collector.&lt;/p&gt;

&lt;p&gt;This commit will also have to be rolled back or modified.&lt;/p&gt;</comment>
                            <comment id="80540" author="auto" created="Tue, 17 Jan 2012 21:48:21 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;bwmcadams&apos;, u&apos;name&apos;: u&apos;Brendan W. McAdams&apos;, u&apos;email&apos;: u&apos;brendan@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-505&quot; title=&quot;Performance regression due to increased memory allocation&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-505&quot;&gt;&lt;del&gt;JAVA-505&lt;/del&gt;&lt;/a&gt; / &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-421&quot; title=&quot;LazyBSONObject exhibits certain behavioral breakages such as improper UTF8 String Parsing&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-421&quot;&gt;&lt;del&gt;JAVA-421&lt;/del&gt;&lt;/a&gt; - Regression  in performance of Java Driver should be rolled back&lt;br/&gt;
Branch: release-2.7.x&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/9910c355ba80a85ff4bfed8cf691f089eb4eb6de&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/9910c355ba80a85ff4bfed8cf691f089eb4eb6de&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="80536" author="auto" created="Tue, 17 Jan 2012 21:38:42 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;bwmcadams&apos;, u&apos;name&apos;: u&apos;Brendan W. McAdams&apos;, u&apos;email&apos;: u&apos;brendan@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-505&quot; title=&quot;Performance regression due to increased memory allocation&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-505&quot;&gt;&lt;del&gt;JAVA-505&lt;/del&gt;&lt;/a&gt; / &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-421&quot; title=&quot;LazyBSONObject exhibits certain behavioral breakages such as improper UTF8 String Parsing&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-421&quot;&gt;&lt;del&gt;JAVA-421&lt;/del&gt;&lt;/a&gt; - Regression  in performance of Java Driver should be rolled back&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/3f927463b0383586ac5df2c7403a370622460aa3&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/3f927463b0383586ac5df2c7403a370622460aa3&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </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|hrhbdr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>14644</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>