<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:13:34 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-1905] SWIG Interface for C Driver</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-1905</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;Would be interesting to see what running the C-Driver through &lt;a href=&quot;http://www.swig.org/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://www.swig.org/&lt;/a&gt; would produce.&lt;/p&gt;</description>
                <environment>C Driver</environment>
        <key id="330067">CDRIVER-1905</key>
            <summary>SWIG Interface for C Driver</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="jesse@mongodb.com">A. Jesse Jiryu Davis</assignee>
                                    <reporter username="joe.drumgoole@mongodb.com">Joe Drumgoole</reporter>
                        <labels>
                    </labels>
                <created>Mon, 7 Nov 2016 14:37:59 +0000</created>
                <updated>Wed, 3 May 2017 22:15:09 +0000</updated>
                            <resolved>Mon, 21 Nov 2016 18:26:58 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1439281" author="jesse" created="Mon, 21 Nov 2016 18:26:58 +0000"  >&lt;p&gt;If anyone desires this, it can be provided outside the C Driver&apos;s own repository.&lt;/p&gt;</comment>
                            <comment id="1428798" author="jesse" created="Tue, 8 Nov 2016 01:37:23 +0000"  >&lt;p&gt;I would &lt;b&gt;not&lt;/b&gt; expect a worthwhile performance gain from a Python wrapper around the C Driver, no matter whether it&apos;s SWIG or any other FFI, when compared to PyMongo. Python applications that talk to MongoDB spend most of their time:&lt;/p&gt;

&lt;p&gt;1. Waiting for the database or the network&lt;br/&gt;
2. Translating between Python native types and BSON&lt;br/&gt;
3. Other stuff.&lt;/p&gt;

&lt;p&gt;As I discovered on a &lt;a href=&quot;https://emptysqua.re/blog/an-enlightening-failure/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;quixotic journey a couple years ago&lt;/a&gt;, the time spent in #2 is mostly transcoding strings between BSON&apos;s UTF-8 and Python&apos;s UCS-2. BSON data always has a lot of strings, and translating between the two encodings takes a while. Python 3.4 optimized the heck out of that path, it&apos;s as fast as it will ever be. The rest of the workload for #2 is translating between BSON and Python dicts, lists, ints, etc., and it&apos;s implemented in PyMongo in heavily optimized C. Here also, more gains are unlikely. Any Python driver, whether it&apos;s PyMongo or something based on the C Driver, has to do this work, and will pay the same cost.&lt;/p&gt;

&lt;p&gt;The remaining logic that&apos;s implemented in Python is #3, and it isn&apos;t a large portion of a typical workload. I suspect that the server selection logic is getting slow, but I&apos;m waiting for reproducible benchmark runs in Evergreen before I investigate that. In any case, the stuff in #3 is the only opportunity that a Python API based on the C Driver would have to beat PyMongo, and it&apos;s never going to be more than 10 or 20 percent of the cost. Replacing it with the C Driver&apos;s implementation probably isn&apos;t worth the hassle.&lt;/p&gt;

&lt;p&gt;If you really want a fast driver, don&apos;t translate between Python types and BSON. That&apos;s why the C Driver seems fast: it doesn&apos;t provide any translation between BSON and HLL data structures. PyMongo has just implemented &lt;a href=&quot;http://api.mongodb.com/python/current/api/bson/raw_bson.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;RawBSONDocument&lt;/a&gt; for this purpose, and we&apos;re starting to take advantage of it in &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=shane.harvey&quot; class=&quot;user-hover&quot; rel=&quot;shane.harvey&quot;&gt;shane.harvey&lt;/a&gt;&apos;s &lt;a href=&quot;https://github.com/mongodb-labs/python-bsonjs&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;BSON-JSON codec&lt;/a&gt; and soon, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=anna.herlihy&quot; class=&quot;user-hover&quot; rel=&quot;anna.herlihy&quot;&gt;anna.herlihy&lt;/a&gt;&apos;s and my BSON-NumPy codec.&lt;/p&gt;</comment>
                            <comment id="1428103" author="joe.drumgoole@10gen.com" created="Mon, 7 Nov 2016 16:53:40 +0000"  >&lt;p&gt;If you like Python, but need C driver speed it would be fairly cool. But not a real thing.  @Andrew.Morrow suggested I raise a ticket so I did based on a discussion in the Drivers slack.&lt;/p&gt;
</comment>
                            <comment id="1427948" author="jesse" created="Mon, 7 Nov 2016 15:39:21 +0000"  >&lt;p&gt;Could you say more about the value of this exercise? =)&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|hsrmmv:</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>