<!-- 
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-509] ClassMap synchronization is a major source of contention</title>
                <link>https://jira.mongodb.org/browse/JAVA-509</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;Synchronization in the ClassMap class is the number one performance issue in our performance tests - specifically, in &lt;tt&gt;BSON.applyDecodingHooks(Object)&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;The problem is that this lock is acquired repeatedly by any thread that is decoding elements, leading to a comb pattern of acquisitions and almost certainly not only guaranteeing contention but a moir&#233; pattern of it leading to heavy switching overhead.&lt;/p&gt;

&lt;p&gt;A better strategy would be a CopyOnWriteMap. We have an Apache licensed &lt;a href=&quot;https://labs.atlassian.com/wiki/display/CONCURRENT/CopyOnWriteMap&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;CopyOnWriteMap impl&lt;/a&gt; if required.&lt;/p&gt;</description>
                <environment>&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/blob/master/src/main/org/bson/BSON.java&quot;&gt;https://github.com/mongodb/mongo-java-driver/blob/master/src/main/org/bson/BSON.java&lt;/a&gt;</environment>
        <key id="28981">JAVA-509</key>
            <summary>ClassMap synchronization is a major source of contention</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="brendan">Brendan W. McAdams</assignee>
                                    <reporter username="jedws">Jed Wesley-Smith</reporter>
                        <labels>
                    </labels>
                <created>Tue, 24 Jan 2012 01:42:12 +0000</created>
                <updated>Mon, 18 Jun 2012 19:36:09 +0000</updated>
                            <resolved>Sat, 10 Mar 2012 20:27:53 +0000</resolved>
                                    <version>2.7.2</version>
                                    <fixVersion>2.8.0</fixVersion>
                                    <component>Performance</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="134047" author="jeff.yemin" created="Mon, 18 Jun 2012 19:36:09 +0000"  >&lt;p&gt;Closing for 2.8.0 release.&lt;/p&gt;</comment>
                            <comment id="97543" author="jeff.yemin" created="Sat, 10 Mar 2012 20:27:53 +0000"  >&lt;p&gt;Pull requests merged in to master&lt;/p&gt;</comment>
                            <comment id="83681" author="brendan" created="Tue, 31 Jan 2012 15:25:24 +0000"  >&lt;p&gt;A fix for this issue has been merged in a branch as part of Pull Request 57 ( &lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/pull/57&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/pull/57&lt;/a&gt; ).&lt;/p&gt;

&lt;p&gt;We are working on finishing evaluating it before a final merge to master.&lt;/p&gt;</comment>
                            <comment id="81871" author="jedws" created="Tue, 24 Jan 2012 01:55:39 +0000"  >&lt;p&gt;The applyDecodingHooks method is not properly threadsafe anyway, as it is possible to racily set &lt;tt&gt;_encodeHooks&lt;/tt&gt; or &lt;tt&gt;_decodeHooks&lt;/tt&gt; before the associated map.put completes, neither update is safely published, and the &lt;tt&gt;_decodingHooks.size()&lt;/tt&gt; call is not atomic with the &lt;tt&gt;decodingHooks.get(o.getClass())&lt;/tt&gt;.&lt;/p&gt;</comment>
                    </comments>
                    <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|hrhbdb:</customfieldvalue>

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