<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:55:37 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-1253] Optimize StatementContextBase layout</title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-1253</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;We currently store CopyHistory as a reference to an object, costing us 4b/8b of storage in StatementContextBase.&lt;/p&gt;

&lt;p&gt;StatementContextBase is the bread&amp;amp;butter of memory/CPU trade-offs and it does not have a single bit of storage left.&lt;/p&gt;

&lt;p&gt;At the end of the day, CopyHistory encodes the following information:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;last CopyType&lt;/li&gt;
	&lt;li&gt;CopyableNode.isAugmenting()&lt;/li&gt;
	&lt;li&gt;AddedByUsesAware.isAddedByUses()&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;This currently boils down to 2+log2(4)=4 significant bits, for which we are storing 32/64 bits.&lt;/p&gt;

&lt;p&gt;Refactor StatementContextBase.copyHistory to be&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;byte&lt;/span&gt; copyHistory;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This frees up 3-7 bytes of storage, which provides 24bits of additional free storage.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Another candidate is StatementContextBase.completedPhase, which again is 4/8 bytes of storage, but it only stores 7 states, i.e. none + ModelProcessingPhase which there are 6 of.&lt;/p&gt;

&lt;p&gt;We could use only 3 bits for storing that state, but that would incur masking operations for sub-byte access. Since this is an utterly hot path, let&apos;s instead keep&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;byte&lt;/span&gt; completedPhase;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Which again frees up 3-7 bytes of storage.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Combining these two, though, we get real gains &#8211; we trim down 8-16 bytes of storage for everything 64bit, while also a creating an unused 2-byte alignment gap. There also remain 4 unused bits in copyHistory, giving us comfortable 20bits if we need to store more information.&lt;/p&gt;</description>
                <environment></environment>
        <key id="33822">YANGTOOLS-1253</key>
            <summary>Optimize StatementContextBase layout</summary>
                <type id="10100" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10310&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.opendaylight.org/images/icons/priorities/major.svg">Medium</priority>
                        <status id="5" iconUrl="https://jira.opendaylight.org/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10000">Done</resolution>
                                        <assignee username="rovarga">Robert Varga</assignee>
                                    <reporter username="rovarga">Robert Varga</reporter>
                        <labels>
                            <label>pt</label>
                    </labels>
                <created>Wed, 17 Feb 2021 19:14:50 +0000</created>
                <updated>Thu, 18 Feb 2021 10:55:34 +0000</updated>
                            <resolved>Thu, 18 Feb 2021 10:55:34 +0000</resolved>
                                                    <fixVersion>7.0.0</fixVersion>
                                    <component>parser</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                                                                <issuelinks>
                            <issuelinktype id="10300">
                    <name>Issue split</name>
                                            <outwardlinks description="split to">
                                        <issuelink>
            <issuekey id="33825">YANGTOOLS-1256</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                            <subtask id="33823">YANGTOOLS-1254</subtask>
                            <subtask id="33824">YANGTOOLS-1255</subtask>
                    </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_10002" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>YANGTOOLS-652</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i03x8n:</customfieldvalue>

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