<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:38: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>[CSHARP-1064] Have pre-created BsonValue instances for common values</title>
                <link>https://jira.mongodb.org/browse/CSHARP-1064</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;We could reduce pressure on the GC by having pre-created instances of many commonly used BsonValues. For example:&lt;/p&gt;

&lt;p&gt;BsonBoolean: true, false&lt;br/&gt;
BsonDouble, -100.0 to 100.0 in 1.0 increments&lt;br/&gt;
BsonInt32/BsonInt64: -100 to 100&lt;br/&gt;
BsonString: empty string&lt;/p&gt;

&lt;p&gt;The way these would be taken advantage of would be in the implicit conversions from primitive types to BsonValues. For example:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;BsonValue a = true; // implicit conversion returns existing BsonBoolean instance for True&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;BsonValue b = 10.0; // implicit conversion returns existing BsonDouble instance for 10.0&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;BsonValue c = -1; // implicit conversion returns existing BsonInt32 instance for -1&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;</description>
                <environment></environment>
        <key id="158519">CSHARP-1064</key>
            <summary>Have pre-created BsonValue instances for common values</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="robert@mongodb.com">Robert Stam</assignee>
                                    <reporter username="robert@mongodb.com">Robert Stam</reporter>
                        <labels>
                    </labels>
                <created>Tue, 16 Sep 2014 20:56:31 +0000</created>
                <updated>Wed, 20 Jan 2016 20:09:57 +0000</updated>
                            <resolved>Tue, 26 May 2015 17:19:28 +0000</resolved>
                                                    <fixVersion>2.1</fixVersion>
                                    <component>BSON</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="923631" author="xgen-internal-githook" created="Tue, 26 May 2015 17:18:47 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;rstam&apos;, u&apos;name&apos;: u&apos;rstam&apos;, u&apos;email&apos;: u&apos;robert@robertstam.org&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-1064&quot; title=&quot;Have pre-created BsonValue instances for common values&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-1064&quot;&gt;&lt;del&gt;CSHARP-1064&lt;/del&gt;&lt;/a&gt;: Modified serializers (and several other places where BsonValues are created) to use implicit conversions so that they can take advantage of pre-created instances.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-csharp-driver/commit/427e417e7995af64ba49871ebb8208e31a049ba4&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-csharp-driver/commit/427e417e7995af64ba49871ebb8208e31a049ba4&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="923630" author="xgen-internal-githook" created="Tue, 26 May 2015 17:18:46 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;rstam&apos;, u&apos;name&apos;: u&apos;rstam&apos;, u&apos;email&apos;: u&apos;robert@robertstam.org&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-1064&quot; title=&quot;Have pre-created BsonValue instances for common values&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-1064&quot;&gt;&lt;del&gt;CSHARP-1064&lt;/del&gt;&lt;/a&gt;: Have pre-created BsonValue instances for common values.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-csharp-driver/commit/01c34eb20b3e813d39ccede6eede2d33ad918be4&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-csharp-driver/commit/01c34eb20b3e813d39ccede6eede2d33ad918be4&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="720710" author="nightroman" created="Wed, 17 Sep 2014 13:00:41 +0000"  >&lt;p&gt;I do not think it is harmful but I do not expect significant improvements either. It is difficult to tell without benchmarks. And proper benchmarks which reflect practical use cases are not that easy.&lt;/p&gt;</comment>
                            <comment id="720693" author="rstam" created="Wed, 17 Sep 2014 12:19:41 +0000"  >&lt;p&gt;The idea with numbers is that certain constants appear frequently. Particularly 0 and 1 (0.0 and 1.0 for doubles). But it is quite cheap to extend the concept to a few hundred values (e.g. -100 to 100) as long as they are consecutive, so we don&apos;t have to do a dictionary lookup.&lt;/p&gt;

&lt;p&gt;Why do you say this approach is not necessarily more effective? Do you think it would be harmful in any way?&lt;/p&gt;</comment>
                            <comment id="720532" author="nightroman" created="Wed, 17 Sep 2014 06:25:28 +0000"  >&lt;p&gt;It looks reasonable perhaps for bool and an empty string but for numbers it is rather odd, especially for double. And this approach is not necessarily more effective.&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|hrfa13:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1491</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="549">C# Sprint 20</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>