<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:55:07 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-1074] Define NormalizedBody and specializations</title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-1074</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;Analysis of a netvirt heap dump is showing that the data tree involved is around 640MiB, with 147MiB (~23%) retained by NormalizedNode implementations (6.5M objects). Each of these is costing typically 24 bytes, with 4 byte alignment shadow - typically containing the identifier and map of children.&lt;/p&gt;

&lt;p&gt;If we eliminate the idea that a NormalizedNode has an identifier, we would save ~49MiB (33% shallow, 13% overall) heap by making these cost typically 16 bytes.&lt;/p&gt;

&lt;p&gt;There are few places where identifier is required, which would have to be changed to carry Map.Entry&amp;lt;PathArgument, NormalizedNode&amp;gt; instead - a change cascading through quite a few interfaces. The most problematic will probably be NormalizedNodeStreamWriter.&lt;/p&gt;

&lt;p&gt;Aside from memory savings, this would solve the interesting problem of DataTree root node (i.e. corresponding to SchemaContext) needing an identifier, which is currently wedged to use SchemaContext.NAME - which can lead to problems with revisions in some cases.&lt;/p&gt;

&lt;p&gt;Consider dropping Identifiable from NormalizedNode, adjusting all users to cope with that.&lt;/p&gt;</description>
                <environment></environment>
        <key id="32357">YANGTOOLS-1074</key>
            <summary>Define NormalizedBody and specializations</summary>
                <type id="10100" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10310&amp;avatarType=issuetype">Improvement</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="rovarga">Robert Varga</reporter>
                        <labels>
                    </labels>
                <created>Wed, 22 Jan 2020 09:25:23 +0000</created>
                <updated>Tue, 19 Sep 2023 16:19:44 +0000</updated>
                                                            <fixVersion>14.0.0</fixVersion>
                                    <component>data-impl</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="67882" author="rovarga" created="Fri, 21 Feb 2020 16:34:23 +0000"  >&lt;p&gt;The idea is to have:&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;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;interface&lt;/span&gt; ContainerNode &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Map.Entry&amp;lt;NodeIdentifier, ContainerNodeState&amp;gt;
        [ &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; SchemaNode state mess],
        Identifiable&amp;lt;NodeIdentifier&amp;gt;, ContainerNodeState {

    &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt; NodeIdentifier getIdentifier() {
       &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; getKey();
    }
}

&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;class &lt;/span&gt;DefaultContainerNode &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; AbstractMap.ImmutableSimpleEntry&amp;lt;NodeIdentifier, ContainerNodeState&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;implements&lt;/span&gt; ContainerNode {

}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;which would be a compat view. Except naming sucks &#8211; is much better to not lug around &quot;State&quot; suffix in most places. It also has performance implications on streaming API, where we really want to propagate these from a Map.entrySet(), otherwise we could end up hurting the GC.&lt;/p&gt;

&lt;p&gt;I do not believe we can deliver this in Aluminium.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="68758" author="rovarga" created="Fri, 13 Nov 2020 22:24:08 +0000"  >&lt;p&gt;The entry part of this proposal needs to be provided separately, as it would end up propagating type. The idea is that NormalizedNode is &lt;b&gt;semantically&lt;/b&gt; equivalent to Entry&amp;lt;PathArgument, ? extends Object&amp;gt;, but we do not express that as a generic parameter by rather through an&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;
NormalizedNode {
  &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt; Entry&amp;lt;? &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; PathArgument, ? &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;&amp;gt; toEntry() {
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Map.entry(getIdentifier(), body());
  }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;We then override this method to provide more precise approcimation, so that:&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;
ContainerNode &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; NormalizedNode {
  @Override
  NodeIdentifier getIdentifier();

  @Override
  ContainerBody body()

  @Override
  &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt; Entry&amp;lt;NodeIdentifier, ContainerBody&amp;gt; toEntry() {
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Map.entry(getIdentifier(), body());
  }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="68759" author="rovarga" created="Fri, 13 Nov 2020 23:38:40 +0000"  >&lt;p&gt;We need the equivalent of ContainerBody for every NormalizedNode so that nodes can reconstructed easily. ForeignDataNodes are an exception: their body is a foreign representation, which we know nothing about (it can be a DOMSource).&lt;/p&gt;</comment>
                            <comment id="71589" author="rovarga" created="Fri, 4 Nov 2022 23:07:07 +0000"  >&lt;p&gt;There is an interesting conflict between LeafNode and AnydataNode: how do we know an AnydataNode is not represented as a byte[], which is the same as a leaf for &apos;type binary&apos;.&lt;br/&gt;
It seems this issue is a bit more thorny: we certainly want to solve ContainerNode (due to identifier) and LeafNode/LeafSetEntryNode (for memory efficiency), but others perhaps can be left alone for later.&lt;/p&gt;

&lt;p&gt;If we scope out those two, they boil down to:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;ValueNode, which covers LeafNode and LeafSetEntryNode. When dealing with reconstitution, LeafSetEntryNode can be known to be allowed only in LeafSetNodes and LeafNode is a DataContainerChild which implies its parent is a DataContainerNode&lt;/li&gt;
	&lt;li&gt;ContainerNode is a DataContainerNode (and DataContainerChild which adds guidance from ValueNode)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Looking at DataContainerNode, it is a DistinctNodeContainer (implying child addressability) and has three specializations:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;ContainerNode&lt;/li&gt;
	&lt;li&gt;LeafSetNode (note: addressability is wild &amp;#8211; either linear position for ordered, or identifier for unordered, this is still subject to evolution)&lt;/li&gt;
	&lt;li&gt;MapNode (addressability, but shares ordering w.r.t. UserMapNode/UserLeafSetNode)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;DataContainerNode itself covers AugmentatioNode (which is going away) and ChoiceNode, ContainerNode, MapEntryNode, MountPointNode&lt;img class=&quot;emoticon&quot; src=&quot;https://jira.opendaylight.org/images/icons/emoticons/warning.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;, UnkeyedListEntryNode &amp;#8211; not all of which reap the memory benefits.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </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_10002" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>YANGTOOLS-1022</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i03qwf:</customfieldvalue>

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