<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:00:26 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>[SERVER-2579] change v8 wrapper to be lazy</title>
                <link>https://jira.mongodb.org/browse/SERVER-2579</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;we need to make the BSON to v8 conversion lazy rather than aggressive, at least optionally.&lt;br/&gt;
so in map/reduce for example, if you only access 2 ints, you don&apos;t convert a huge object&lt;/p&gt;</description>
                <environment></environment>
        <key id="14786">SERVER-2579</key>
            <summary>change v8 wrapper to be lazy</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="antoine">Antoine Girbal</assignee>
                                    <reporter username="eliot">Eliot Horowitz</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 Feb 2011 19:41:52 +0000</created>
                <updated>Tue, 12 Jul 2016 00:18:42 +0000</updated>
                            <resolved>Mon, 2 May 2011 23:07:55 +0000</resolved>
                                                    <fixVersion>1.9.1</fixVersion>
                                    <component>JavaScript</component>
                                        <votes>2</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="51657" author="axlfu" created="Wed, 31 Aug 2011 00:34:07 +0000"  >&lt;p&gt;Seems it won&apos;t depents on &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-2407&quot; title=&quot;Switch to v8&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-2407&quot;&gt;&lt;del&gt;SERVER-2407&lt;/del&gt;&lt;/a&gt;  Switch to v8, u can remove this dependency&lt;/p&gt;</comment>
                            <comment id="32694" author="auto" created="Fri, 13 May 2011 23:33:48 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;agirbal&apos;, u&apos;name&apos;: u&apos;agirbal&apos;, u&apos;email&apos;: u&apos;antoine@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-2579&quot; title=&quot;change v8 wrapper to be lazy&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-2579&quot;&gt;&lt;del&gt;SERVER-2579&lt;/del&gt;&lt;/a&gt;: print warning if modifying r/o object&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/17e2688d76428cacad37f89252882bbf046f0bda&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/17e2688d76428cacad37f89252882bbf046f0bda&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="31990" author="auto" created="Tue, 10 May 2011 22:30:19 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;agirbal&apos;, u&apos;name&apos;: u&apos;agirbal&apos;, u&apos;email&apos;: u&apos;antoine@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-2579&quot; title=&quot;change v8 wrapper to be lazy&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-2579&quot;&gt;&lt;del&gt;SERVER-2579&lt;/del&gt;&lt;/a&gt;: added readonly object for lazy v8 objects, which makes them much faster to access&lt;br/&gt;
&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-2976&quot; title=&quot;add a pure JS mode to map reduce to get improved performance for light jobs&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-2976&quot;&gt;&lt;del&gt;SERVER-2976&lt;/del&gt;&lt;/a&gt;: further implementation of jsMode for M/R. Can be turned on using temp flag jsMode:true&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/13e71279c964fc3f84e682901f37152935557f70&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/13e71279c964fc3f84e682901f37152935557f70&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="30724" author="auto" created="Mon, 2 May 2011 23:08:59 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;agirbal&apos;, u&apos;name&apos;: u&apos;agirbal&apos;, u&apos;email&apos;: u&apos;antoine@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-2579&quot; title=&quot;change v8 wrapper to be lazy&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-2579&quot;&gt;&lt;del&gt;SERVER-2579&lt;/del&gt;&lt;/a&gt;: optimize append() method to use same BSONObj builder throughout process&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/04d364a44d34b22c2c44df9240025bc01730ae1d&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/04d364a44d34b22c2c44df9240025bc01730ae1d&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="30723" author="auto" created="Mon, 2 May 2011 23:08:58 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;agirbal&apos;, u&apos;name&apos;: u&apos;agirbal&apos;, u&apos;email&apos;: u&apos;antoine@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-2579&quot; title=&quot;change v8 wrapper to be lazy&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-2579&quot;&gt;&lt;del&gt;SERVER-2579&lt;/del&gt;&lt;/a&gt;: all v8 object creation is now lazy.&lt;br/&gt;
Correct allocation and freeing of underlying C++ object.&lt;br/&gt;
Correct ordering of object properties even when new ones are added within JS.&lt;br/&gt;
Supports deletion of properties with lazzy wrapper.&lt;/p&gt;

&lt;p&gt;Also removed scope-&amp;gt;setThis in favor of passing it in the invoke() command.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/1725803c209ddf6ca52190447ddb1bdbc7371719&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/1725803c209ddf6ca52190447ddb1bdbc7371719&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="29591" author="auto" created="Mon, 25 Apr 2011 19:27:31 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;agirbal&apos;, u&apos;name&apos;: u&apos;agirbal&apos;, u&apos;email&apos;: u&apos;antoine@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-2579&quot; title=&quot;change v8 wrapper to be lazy&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-2579&quot;&gt;&lt;del&gt;SERVER-2579&lt;/del&gt;&lt;/a&gt;: added framework for lazy v8&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/c75b2cbae1b0d6315324cd94a11d4ea460676047&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/c75b2cbae1b0d6315324cd94a11d4ea460676047&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="29584" author="auto" created="Mon, 25 Apr 2011 18:03:19 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;agirbal&apos;, u&apos;name&apos;: u&apos;agirbal&apos;, u&apos;email&apos;: u&apos;antoine@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-2579&quot; title=&quot;change v8 wrapper to be lazy&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-2579&quot;&gt;&lt;del&gt;SERVER-2579&lt;/del&gt;&lt;/a&gt;: added framework for lazy v8&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/c75b2cbae1b0d6315324cd94a11d4ea460676047&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/c75b2cbae1b0d6315324cd94a11d4ea460676047&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="29262" author="antoine" created="Tue, 19 Apr 2011 05:45:50 +0000"  >&lt;p&gt;Been doing some testing with wrapper and the performance is quite slower (2x) when using lazily populated arrays vs creating whole array ahead.&lt;br/&gt;
Most likely it&apos;s due to the creation of array of keys when iterating, and the use of interceptors.&lt;br/&gt;
Assuming that once an array is requested in js, most likely most values will be accessed, so it would makes sense to create full array.&lt;br/&gt;
The lazy access would still remain for any object / subobject.&lt;br/&gt;
This would also makes things cleaner in code because v8 does not support array creation from a template, and I had to add some hacks to make an object behave like an array.&lt;/p&gt;</comment>
                            <comment id="27956" author="antoine" created="Wed, 6 Apr 2011 16:24:08 +0000"  >&lt;p&gt;so when I started v8 seemed to be quite slow, about 10x for a simple group.&lt;br/&gt;
Did following so far:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;implemented lazy access to fields&lt;/li&gt;
	&lt;li&gt;use global objectTemplate instead of creating 1 for each object&lt;/li&gt;
	&lt;li&gt;a few other optims&lt;br/&gt;
This brought the group performance in line with spider monkey for small objects.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;This get the following results for mr1.js&lt;br/&gt;
antoine@ag410:~/workspace/tengen/mongo$ grep timeMill newv8.log &lt;br/&gt;
	&quot;timeMillis&quot; : 28,&lt;br/&gt;
	&quot;timeMillis&quot; : 1,&lt;br/&gt;
	&quot;timeMillis&quot; : 2,&lt;br/&gt;
	&quot;timeMillis&quot; : 3,&lt;br/&gt;
	&quot;timeMillis&quot; : 42,&lt;br/&gt;
	&quot;timeMillis&quot; : 36,&lt;br/&gt;
	&quot;timeMillis&quot; : 947,&lt;br/&gt;
	&quot;timeMillis&quot; : 745,&lt;br/&gt;
antoine@ag410:~/workspace/tengen/mongo$ grep timeMill spider.log &lt;br/&gt;
	&quot;timeMillis&quot; : 33,&lt;br/&gt;
	&quot;timeMillis&quot; : 1,&lt;br/&gt;
	&quot;timeMillis&quot; : 3,&lt;br/&gt;
	&quot;timeMillis&quot; : 3,&lt;br/&gt;
	&quot;timeMillis&quot; : 73,&lt;br/&gt;
	&quot;timeMillis&quot; : 78,&lt;br/&gt;
	&quot;timeMillis&quot; : 1358,&lt;br/&gt;
	&quot;timeMillis&quot; : 923,&lt;/p&gt;

&lt;p&gt;so far about 20-30% gain, potentially more as objects get much larger.&lt;br/&gt;
I have to look at each field translation details see if that can be improved.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="14306">SERVER-2407</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 6 Apr 2011 16:24:08 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        12 years, 25 weeks, 1 day ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></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_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            12 years, 25 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>antoine</customfieldvalue>
            <customfieldvalue>auto</customfieldvalue>
            <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>axlfu</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrp5u7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hridgn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>20833</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrjbsv:</customfieldvalue>

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