<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:12:14 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>[CDRIVER-1344] Any way to deserialize BSON faster?</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-1344</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;I unfortunately due to poor design have a MongoDB query that returns 2k+ docs that runs quiet often. The query itself takes less than 10ms, however the client side parsing takes over 300ms.&lt;/p&gt;

&lt;p&gt;Is there anyway to introduce threading into the BSON deserializing when it is for arrays?&lt;/p&gt;</description>
                <environment>Any</environment>
        <key id="296722">CDRIVER-1344</key>
            <summary>Any way to deserialize BSON faster?</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="-1">Unassigned</assignee>
                                    <reporter username="brandonros">Brandon Ros</reporter>
                        <labels>
                    </labels>
                <created>Sun, 26 Jun 2016 05:19:15 +0000</created>
                <updated>Wed, 11 Sep 2019 19:05:20 +0000</updated>
                            <resolved>Sun, 26 Jun 2016 16:35:43 +0000</resolved>
                                    <version>TBD</version>
                                                    <component>json</component>
                    <component>libbson</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1306935" author="jesse" created="Mon, 27 Jun 2016 02:58:16 +0000"  >&lt;p&gt;Brandon, I have &lt;b&gt;not&lt;/b&gt; used OpenMP and I can&apos;t help diagnose why your code would run slower than you expect. If you write some pure C with the pthread library and do something parallelizable (no locks that block other threads) with each document in a separate thread, you ought to see a speedup on a multiprocessor machine. But everything depends on the code, the algorithm, and the language runtime you&apos;re using.&lt;/p&gt;</comment>
                            <comment id="1306847" author="brandonros" created="Sun, 26 Jun 2016 21:39:53 +0000"  >&lt;p&gt;A. Jesse Jirryu,&lt;/p&gt;

&lt;p&gt;I was referring to the latter method you&apos;ve described. &lt;/p&gt;

&lt;p&gt;Which language do you think is best to attempt this in? OpenMP with C proved slower than a single thread. :/&lt;/p&gt;</comment>
                            <comment id="1306811" author="jesse" created="Sun, 26 Jun 2016 16:35:38 +0000"  >&lt;p&gt;Brandon, I believe the answer is &quot;no&quot;, there isn&apos;t a practical way to use multiple threads to deserialize a &lt;b&gt;single&lt;/b&gt; BSON document. BSON&apos;s an inherently serial format, and it doesn&apos;t provide any jump offsets at the beginning: one thread has to deserialize the whole thing from start to finish in order to discover the location of all elements.&lt;/p&gt;

&lt;p&gt;Better instead to allocate a set of documents to each thread and parallelize that way, rather than trying to put several threads to work on any one document.&lt;/p&gt;</comment>
                            <comment id="1306792" author="brandonros" created="Sun, 26 Jun 2016 15:40:55 +0000"  >&lt;p&gt;@A. Jesse Jiryu David - It is not that it is particularly slow. I&apos;ve tried C, Java, and node.js. I was wondering if it could be threaded to any performance benefit.&lt;/p&gt;

&lt;p&gt;I&apos;m deserializing docs that look like this (an array of 2k at a time for a total of ~6MB): &lt;a href=&quot;https://gist.github.com/brandonros/169290791aabd1a8570067b44804d46c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://gist.github.com/brandonros/169290791aabd1a8570067b44804d46c&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1306778" author="jesse" created="Sun, 26 Jun 2016 14:37:18 +0000"  >&lt;p&gt;Hi, could you show me a complete code example that I can compile and run that demonstrates the slow performance?&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|hsmwhb:</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>