<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:53:54 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>OpenDaylight JIRA</title>
    <link>https://jira.opendaylight.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.20.10</version>
        <build-number>820010</build-number>
        <build-date>22-06-2022</build-date>
    </build-info>


<item>
            <title>[YANGTOOLS-652] Improve YANG parser performance and footprint</title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-652</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;Similar to earlier &lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-629&quot; title=&quot;Performance optimization potential in yang loading? Profiling SingleFeatureTest shows Hot Methods in e.g. StmtContextUtils &amp;amp; StatementDefinitionContext&quot; class=&quot;issue-link&quot; data-issue-key=&quot;YANGTOOLS-629&quot;&gt;&lt;del&gt;YANGTOOLS-629&lt;/del&gt;&lt;/a&gt; I&apos;ve done some profiling of SingleFeatureTest (in netvirt/vpnservice/features) using &lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/41349/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/41349/&lt;/a&gt;, and obtained results such as the attached Java Mission Control Flight Recorder JFR ... &lt;/p&gt;

&lt;p&gt;mvn runs for a total time of 22 min. and produces 5x JFRs, because SingleFeatureTest starts 5 separate Karaf JVMs.  Of these, 1 of 5 is not that interesting as very short, and the other 4 all run for 2-3 minutes and all 4 very show very similar hotspots; I&apos;ve attached one of them as *.jfr.zip: We spend total 70% (= 30% java.util, 20% com.google.common.collect, 20% org.opendaylight.yangtools.yang.parser.stmt.reactor) around kind of call stack shown in attached *stacks.txt.&lt;/p&gt;

&lt;p&gt;There is probably another separate, and bigger issue elsewhere - because this (above) only accounts for ~ 4*3&apos; =~ 12 min - so there is 10&apos; spent somewhere else, in the SingleFeatureTest (not forked Karaf) JVM doing.. I&apos;m not sure what; will try to find out more.  Independently fixing this performance bottleneck in YANG Tools already would certainly still be beneficial anyway.&lt;/p&gt;

&lt;p&gt;Robert &amp;amp; Peter, I&apos;m hoping you can work similar magic here like you had in &lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-629&quot; title=&quot;Performance optimization potential in yang loading? Profiling SingleFeatureTest shows Hot Methods in e.g. StmtContextUtils &amp;amp; StatementDefinitionContext&quot; class=&quot;issue-link&quot; data-issue-key=&quot;YANGTOOLS-629&quot;&gt;&lt;del&gt;YANGTOOLS-629&lt;/del&gt;&lt;/a&gt;? &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.opendaylight.org/images/icons/emoticons/wink.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: All&lt;br/&gt;
Platform: All&lt;/p&gt;</environment>
        <key id="23072">YANGTOOLS-652</key>
            <summary>Improve YANG parser performance and footprint</summary>
                <type id="10000" iconUrl="https://jira.opendaylight.org/images/icons/issuetypes/epic.svg">Epic</type>
                                            <priority id="2" iconUrl="https://jira.opendaylight.org/images/icons/priorities/critical.svg">High</priority>
                        <status id="10003" iconUrl="https://jira.opendaylight.org/images/icons/status_generic.gif" description="">Confirmed</status>
                    <statusCategory id="2" key="new" colorName="blue-gray"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="vorburger">Michael Vorburger</reporter>
                        <labels>
                    </labels>
                <created>Wed, 24 Aug 2016 11:41:06 +0000</created>
                <updated>Thu, 6 Apr 2023 16:22:46 +0000</updated>
                                                                                <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="44055" author="vorburger" created="Wed, 24 Aug 2016 11:41:06 +0000"  >&lt;p&gt;Attachment SingleFeatureTest-Karaf-JavaFlightRecorder1118899505783732969.jfr.zip has been added with description: JMC&lt;/p&gt;</comment>
                            <comment id="44056" author="vorburger" created="Wed, 24 Aug 2016 11:41:49 +0000"  >&lt;p&gt;Attachment bug6522_stacks.txt has been added with description: Hot Methods Stack Traces&lt;/p&gt;</comment>
                            <comment id="44050" author="pkajsa" created="Wed, 24 Aug 2016 13:26:43 +0000"  >&lt;p&gt;As I mentioned in our email conversation, we will have to look at it closer and try to find out the root cause. So we will see what we can do in this matter.&lt;/p&gt;

&lt;p&gt;Thanks.&lt;br/&gt;
Peter&lt;/p&gt;</comment>
                            <comment id="44051" author="vorburger" created="Wed, 24 Aug 2016 16:18:08 +0000"  >&lt;p&gt;&amp;gt; another separate, and bigger issue elsewhere - (...) there is 10&apos; spent somewhere else in the&lt;br/&gt;
&amp;gt; SingleFeatureTest (not forked Karaf) JVM doing.. I&apos;m not sure what; will try to find out more.  &lt;/p&gt;

&lt;p&gt;FTR: I&apos;m not able to reliably reproduce and profile this part anymore - huh?!  I&apos;m, now, consistently seeing mvn in netvirt/vpnservice/features at Total time: 10:15 min, which is roughly in line with the finding above for YANG parsing.  I will stop chasing another angle, and just profile SingleFeatureTest again from scratch once this issue here will have been addressed.&lt;/p&gt;</comment>
                            <comment id="44052" author="vorburger" created="Tue, 8 Nov 2016 13:52:18 +0000"  >&lt;p&gt;Linking &lt;a href=&quot;https://jira.opendaylight.org/browse/CONTROLLER-1480&quot; title=&quot;Remove XSQL&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CONTROLLER-1480&quot;&gt;&lt;del&gt;CONTROLLER-1480&lt;/del&gt;&lt;/a&gt; (just pointed out by Stephen in private emails), seems related..&lt;/p&gt;</comment>
                            <comment id="44053" author="vrpolak" created="Tue, 8 Nov 2016 14:59:30 +0000"  >&lt;p&gt;Similar symptoms were described here: &lt;a href=&quot;https://bugs.opendaylight.org/show_bug.cgi?id=4462&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://bugs.opendaylight.org/show_bug.cgi?id=4462&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="44054" author="rovarga" created="Mon, 19 Dec 2016 19:11:56 +0000"  >&lt;p&gt;The codebase has shifted significantly since August, so I would suggest collecting a new set of data from current master.&lt;/p&gt;

&lt;p&gt;One problem identified, though, is SubstatementContext.isConfiguration(), this patch: &lt;a href=&quot;https://git.opendaylight.org/gerrit/49567&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/49567&lt;/a&gt; should speed it up significantly.&lt;/p&gt;</comment>
                            <comment id="67627" author="rovarga" created="Wed, 8 Jan 2020 21:17:31 +0000"  >&lt;p&gt;So the heap/performance profile for Junos 19.3&#160; with yangtools-4.0.4 looks like this:&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;15512_thumb&quot; href=&quot;https://jira.opendaylight.org/secure/attachment/15512/15512_yt692-heap.png&quot; title=&quot;yt692-heap.png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;15512&quot; file-preview-title=&quot;yt692-heap.png&quot;&gt;&lt;img src=&quot;https://jira.opendaylight.org/secure/thumbnail/15512/_thumb_15512.png&quot; height=&quot;112&quot; width=&quot;196&quot; style=&quot;border: 0px solid black&quot; role=&quot;presentation&quot;/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;15513_thumb&quot; href=&quot;https://jira.opendaylight.org/secure/attachment/15513/15513_yt692-retained.png&quot; title=&quot;yt692-retained.png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;15513&quot; file-preview-title=&quot;yt692-retained.png&quot;&gt;&lt;img src=&quot;https://jira.opendaylight.org/secure/thumbnail/15513/_thumb_15513.png&quot; style=&quot;border: 0px solid black&quot; role=&quot;presentation&quot;/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;which shows that:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;we processed the models in ~46 seconds&lt;/li&gt;
	&lt;li&gt;peak memory usage was 2.7GiB&lt;/li&gt;
	&lt;li&gt;final SchemaContext was ~1GiB&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;The primary cause of memory usage (and also CPU usage) is &lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-694&quot; title=&quot;Eliminate duplicate DescriptionEffectiveStatementImpl objects&quot; class=&quot;issue-link&quot; data-issue-key=&quot;YANGTOOLS-694&quot;&gt;&lt;del&gt;YANGTOOLS-694&lt;/del&gt;&lt;/a&gt;, which creates a lot of contexts during &apos;uses&apos; propagation (~1.7GiB).&lt;/p&gt;

&lt;p&gt;While the SchemaContext size can also be blamed on that issue, it highlights the fact that individual effective statement objects are larger that they need to be:&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;15516_thumb&quot; href=&quot;https://jira.opendaylight.org/secure/attachment/15516/15516_yt-692-desc-impl.png&quot; title=&quot;yt-692-desc-impl.png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;15516&quot; file-preview-title=&quot;yt-692-desc-impl.png&quot;&gt;&lt;img src=&quot;https://jira.opendaylight.org/secure/thumbnail/15516/_thumb_15516.png&quot; style=&quot;border: 0px solid black&quot; role=&quot;presentation&quot;/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;in this case there are known invariants:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;description is always declared&lt;/li&gt;
	&lt;li&gt;it typically does not have substatements (but it could have extensions)&lt;/li&gt;
	&lt;li&gt;its argument matches the declared statement&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Hence there is room for improvement with regard to object layout, possibly with specializations.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="69541" author="rovarga" created="Thu, 2 Sep 2021 14:39:47 +0000"  >&lt;p&gt;With current yangtools-8.0.0-SNAPSHOT the performance looks much better:&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;16503_thumb&quot; href=&quot;https://jira.opendaylight.org/secure/attachment/16503/16503_junos_yt800_perf.png&quot; title=&quot;junos_yt800_perf.png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;16503&quot; file-preview-title=&quot;junos_yt800_perf.png&quot;&gt;&lt;img src=&quot;https://jira.opendaylight.org/secure/thumbnail/16503/_thumb_16503.png&quot; style=&quot;border: 0px solid black&quot; role=&quot;presentation&quot;/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;</comment>
                            <comment id="69542" author="rovarga" created="Thu, 2 Sep 2021 14:41:13 +0000"  >&lt;p&gt;Heap composition is also much saner, with SchemaPath objects gone and only about 10M objects.&lt;br/&gt;
&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;16502_thumb&quot; href=&quot;https://jira.opendaylight.org/secure/attachment/16502/16502_junos_yt800_heap.png&quot; title=&quot;junos_yt800_heap.png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;16502&quot; file-preview-title=&quot;junos_yt800_heap.png&quot;&gt;&lt;img src=&quot;https://jira.opendaylight.org/secure/thumbnail/16502/_thumb_16502.png&quot; height=&quot;600&quot; width=&quot;1101&quot; style=&quot;border: 0px solid black&quot; role=&quot;presentation&quot;/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;</comment>
                            <comment id="70332" author="rovarga" created="Mon, 6 Dec 2021 12:01:13 +0000"  >&lt;p&gt;With &lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-1067&quot; title=&quot;Use flyweight EffectiveStatement implementations&quot; class=&quot;issue-link&quot; data-issue-key=&quot;YANGTOOLS-1067&quot;&gt;&lt;del&gt;YANGTOOLS-1067&lt;/del&gt;&lt;/a&gt; and a few other yangtools-8 deliverables we are down to ~3.5M objects.&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;img src=&quot;https://jira.opendaylight.org/secure/attachment/17102/17102_image-2021-12-06-13-00-49-525.png&quot; height=&quot;786&quot; width=&quot;1438&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/span&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10000">
                    <name>Blocks</name>
                                                                <inwardlinks description="is blocked by">
                                        <issuelink>
            <issuekey id="32326">YANGTOOLS-1066</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                            <outwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="34657">YANGTOOLS-1348</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="29296">YANGTOOLS-855</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="13057" name="SingleFeatureTest-Karaf-JavaFlightRecorder1118899505783732969.jfr.zip" size="563859" author="vorburger" created="Wed, 24 Aug 2016 11:41:06 +0000"/>
                            <attachment id="13058" name="bug6522_stacks.txt" size="5454" author="vorburger" created="Wed, 24 Aug 2016 11:41:49 +0000"/>
                            <attachment id="17102" name="image-2021-12-06-13-00-49-525.png" size="660678" author="rovarga" created="Mon, 6 Dec 2021 12:00:51 +0000"/>
                            <attachment id="16502" name="junos_yt800_heap.png" size="684468" author="rovarga" created="Thu, 2 Sep 2021 14:38:44 +0000"/>
                            <attachment id="16503" name="junos_yt800_perf.png" size="154489" author="rovarga" created="Thu, 2 Sep 2021 14:38:43 +0000"/>
                            <attachment id="15516" name="yt-692-desc-impl.png" size="167384" author="rovarga" created="Wed, 8 Jan 2020 21:34:32 +0000"/>
                            <attachment id="15512" name="yt692-heap.png" size="202651" author="rovarga" created="Wed, 8 Jan 2020 21:14:28 +0000"/>
                            <attachment id="15513" name="yt692-retained.png" size="161123" author="rovarga" created="Wed, 8 Jan 2020 21:19:24 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_11400" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10004" key="com.pyxis.greenhopper.jira:gh-epic-label">
                        <customfieldname>Epic Name</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Parser Performance</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10208" key="com.atlassian.jira.plugin.system.customfieldtypes:textfield">
                        <customfieldname>External issue ID</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6522</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10201" key="com.atlassian.jira.plugin.system.customfieldtypes:url">
                        <customfieldname>External issue URL</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[https://bugs.opendaylight.org/show_bug.cgi?id=6522]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10206" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Issue Type</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10305"><![CDATA[Improvement]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i028jr:</customfieldvalue>

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