<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:36:17 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>[CSHARP-256] Debug build used for releases</title>
                <link>https://jira.mongodb.org/browse/CSHARP-256</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;While doing some performance research on BsonArray creation (some parts of our persistence framework uses arrays heavily so I&apos;m always on a lookout for unnecessary copying, more on that later), I found out that the released 1.1.0.4184 (CSharpDriver-1.1.0.4184.zip from github, didn&apos;t check the .msi version) has performance that is lower to the binaries I&apos;ve built from the same version tag sources. It appears that at least .zip release contains debug versions of binaries (both MongoDB driver and BSON library). I wonder if this is intentional (for example to facilitate better stack traces) or accidental?&lt;/p&gt;</description>
                <environment></environment>
        <key id="18668">CSHARP-256</key>
            <summary>Debug build used for releases</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="5" iconUrl="https://jira.mongodb.org/images/icons/priorities/trivial.svg">Trivial - P5</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="sridhar">Sridhar Nanjundeswaran</assignee>
                                    <reporter username="onyxmaster">Aristarkh Zagorodnikov</reporter>
                        <labels>
                    </labels>
                <created>Fri, 24 Jun 2011 12:22:06 +0000</created>
                <updated>Thu, 2 Apr 2015 18:28:29 +0000</updated>
                            <resolved>Tue, 27 Mar 2012 14:23:47 +0000</resolved>
                                    <version>1.1</version>
                                    <fixVersion>1.4</fixVersion>
                                                        <votes>2</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="103775" author="zippy1981" created="Mon, 26 Mar 2012 21:36:41 +0000"  >&lt;p&gt;Robert,&lt;/p&gt;

&lt;p&gt;If you set the assembly search path in Visual Studio the line numbers show up. Would you like a patch that will do that automatically in the installer? I never automated that, but I&apos;m sure I could figure it out.&lt;/p&gt;

&lt;p&gt;Justin&lt;/p&gt;</comment>
                            <comment id="103747" author="rstam" created="Mon, 26 Mar 2012 20:24:34 +0000"  >&lt;p&gt;I have not tried setting  &quot;Debug Info&quot; to &quot;full&quot; instead of &quot;pdb-only&quot;.&lt;/p&gt;

&lt;p&gt;Thanks for testing that the Debug build doesn&apos;t provide line numbers either when installed in the GAC. Based on that we might as well use the Release build and figure out later if there is a way to get line numbers in stack traces when using a DLL from the GAC.&lt;/p&gt;</comment>
                            <comment id="103736" author="onyxmaster" created="Mon, 26 Mar 2012 20:01:30 +0000"  >&lt;p&gt;I would also like to note that Debug vs Release builds don&apos;t help if you&apos;re doing GAC install. I installed the latest 1.3.1 MSI from github, created a new project and added reference to MongoDB.Driver &amp;amp; MongoDB.Bson from the GAC, then called MongoDB.Driver.MongoDatabase.Create((string)null) and still had no line information. Adding MongoDB.*.pdb to the bin/Debug folder of my test application didn&apos;t help.&lt;/p&gt;</comment>
                            <comment id="103729" author="onyxmaster" created="Mon, 26 Mar 2012 19:46:27 +0000"  >&lt;p&gt;Yes, I know this is not the best way, just asking if you tried this or not.&lt;/p&gt;</comment>
                            <comment id="103725" author="onyxmaster" created="Mon, 26 Mar 2012 19:41:21 +0000"  >&lt;p&gt;I wonder if you changed the &quot;Debug Info&quot; (Project Properties-&amp;gt;Build-&amp;gt;Advanced...) to &quot;full&quot; instead of &quot;pdb-only&quot; in Release builds?&lt;/p&gt;</comment>
                            <comment id="103652" author="rstam" created="Mon, 26 Mar 2012 17:03:35 +0000"  >&lt;p&gt;We are going to postpone changing to Debug release until the next version.&lt;/p&gt;

&lt;p&gt;Turns out that if you install the DLLs in the GAC (like the .msi based setup does) then you don&apos;t get line numbers in your stack trace even if you have the .pdb files in your executable directory.&lt;/p&gt;

&lt;p&gt;We find line number in exceptions reported back to us incredibly useful, so until we can guarantee that we get line numbers in stack traces under all possible deployment scenarios we are sticking to Debug.&lt;/p&gt;</comment>
                            <comment id="101611" author="rstam" created="Thu, 22 Mar 2012 20:41:38 +0000"  >&lt;p&gt;Changed where I could find that Debug need to become Release.&lt;/p&gt;</comment>
                            <comment id="98994" author="rstam" created="Thu, 15 Mar 2012 02:29:01 +0000"  >&lt;p&gt;The 1.4 release will be created using Release builds.&lt;/p&gt;</comment>
                            <comment id="46313" author="onyxmaster" created="Thu, 4 Aug 2011 09:03:27 +0000"  >&lt;p&gt;Small performance test that I mentioned in my comment.&lt;/p&gt;</comment>
                            <comment id="46312" author="onyxmaster" created="Thu, 4 Aug 2011 09:01:39 +0000"  >&lt;p&gt;Unfortunately, none of the answers on the aforementioned Stack Overflow question state that &quot;there may not be a measurable perf difference between the two&quot;. The question asks if there is a difference, and the accepted answer stats that it is &quot;Partially true&quot;, with Mr. Lippert pointing to a (fairly extensive) list of compiler optimizations (&lt;a href=&quot;http://blogs.msdn.com/b/ericlippert/archive/2009/06/11/what-does-the-optimize-switch-do.aspx&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://blogs.msdn.com/b/ericlippert/archive/2009/06/11/what-does-the-optimize-switch-do.aspx&lt;/a&gt;). Some answers make a good point that most of the difference occurs whether you run code under the debugger or not, since JIT is known to suppress specific optimizations when debugger is attached. Many other answers talking about assembly load times, which is not relevant to this topic.&lt;/p&gt;

&lt;p&gt;In fact, there is a measurable difference, and while I won&apos;t go into lengthy discussion about &quot;why compiler optimization still helps for managed code&quot;, I would like to present you a small VS2010 solution (attached), that demonstrates the said difference.&lt;br/&gt;
The Driver\Debug contains the BSON library from the 1.1.0.4184 zip archive, while Driver\Release contains the same library built from the source code that corresponds to that version (git rev g29f3acd) in Release configuration.&lt;br/&gt;
On my workstation, the resulting code that links with the Debug library can create about 2640 arrays per second, while the one linked with Release build does about 3350, more than 25% improvement.&lt;br/&gt;
Yes, I understand that my so-called &quot;performance test&quot; is primitive and synthetic, but you asked for an example =)&lt;/p&gt;

&lt;p&gt;Now, a few thoughs about deployment. Personally, I don&apos;t care much about deployment itself, since we&apos;re building most of the dependencies from source (and already have an MQ patch queue for the mongodb-csharp-driver) , so having something outdated installed in the GAC would do more harm than good to us (and it&apos;s easier to bin-deploy to server farms, I can&apos;t imagine myself deploying anything into GAC on 10+ machines, while rsync-ing to staging areas and then switching production application with staging one is easy and reliable). &lt;br/&gt;
Although, I see almost no point in deploying non-optimized assemblies at all. While in C++ (especially with interprocedural optimization aka WPO), fully optimized binary cannot reliably get it&apos;s own stack trace, because of extensive frame pointer omissions and non-conventional parameter passing (so you have to resort to having at least a &quot;partially-optimized&quot; binaries to diagnose problems, along with decoding FPO optimizations and parameter passing conventions when walking the stack), the C# has a much better picture, because the stack is always available (it will omit inlined functions, but that usually doesn&apos;t matter, because JIT inlining isn&apos;t that aggressive). Yes, there is a small problem with stacks for unmanaged exceptions (NullReferenceException, AccessViolationException, etc.) &amp;#8211; the top of the stack may contain wrong line number information due to call sites not being padded by breakpoint no-op &quot;pillows&quot;, but I never spend more than a few minutes discovering how &quot;int f = a + b;&quot; can cause an NRE, when &quot;a&quot; and &quot;b&quot; are both local integer variables, so I don&apos;t think it&apos;s that much of a problem.&lt;/p&gt;</comment>
                            <comment id="46166" author="sridhar" created="Wed, 3 Aug 2011 17:53:21 +0000"  >&lt;p&gt;&lt;a href=&quot;http://stackoverflow.com/questions/2446027/c-debug-vs-release-performance&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://stackoverflow.com/questions/2446027/c-debug-vs-release-performance&lt;/a&gt; seems to indicate there may not be a measurable perf difference between the two. Aristarkh can you attach a sample of the code which shows the difference? Thanks. Also we currently have 3 delivery mechanisms for the driver&lt;br/&gt;
1) msi&lt;br/&gt;
2) zip file&lt;br/&gt;
3) nuget packages. &lt;br/&gt;
We need to have a solution that allows us to package debug and release in all 3. I propose creating debug and release sub folders for all 3. For msi the question becomes which of the binaries do we install in the GAC by default. Thoughts?&lt;/p&gt;</comment>
                            <comment id="44178" author="zippy1981" created="Sat, 23 Jul 2011 12:19:56 +0000"  >&lt;p&gt;I think the MSI should ship with the release builds and the PDB. You still get line numbers in stack traces when something goes awry, but you don&apos;t get the performance overhead. BTW, I&apos;m willing to be educated that I am wrong about the previous statement, but I know their are other aspects to a debug build besides the PDB database that do negatively affect performance.&lt;/p&gt;</comment>
                            <comment id="39311" author="onyxmaster" created="Mon, 27 Jun 2011 12:01:50 +0000"  >&lt;p&gt;I believe shipping Release-only binaries would be fine. If one is going to debug the driver code, he&apos;ll need sources anyways, so he can build the debug binaries by himself.&lt;/p&gt;</comment>
                            <comment id="39060" author="rstam" created="Fri, 24 Jun 2011 13:27:12 +0000"  >&lt;p&gt;It was intentional. But perhaps in the next release we should start shipping Release versions. One possibility would be to ship both. Anyone else have any input?&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="12483" name="perftest.zip" size="677830" author="onyxmaster" created="Thu, 4 Aug 2011 09:03:27 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <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|hrh8rz:</customfieldvalue>

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