Use flyweight EffectiveStatement implementations (YANGTOOLS-1067)

[YANGTOOLS-1212] Reuse effective substatement lists when possible Created: 26/Jan/21  Updated: 27/Jan/21  Resolved: 27/Jan/21

Status: Resolved
Project: yangtools
Component/s: parser
Affects Version/s: None
Fix Version/s: 7.0.0

Type: Sub-task Priority: Medium
Reporter: Robert Varga Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

This is the first step in fly-weight statements. As described in YANGTOOLS-1067, we want to reuse List<EffectiveStatement> instances if they do not change during the copy operation.

This is mostly yang-parser-reactor work, but also requires exposing access to AbstractStatementSupport.createEffective(Current, List).

This should prove effective in this test case:

 

module foo {
  namespace foo;
  prefix foo;

  grouping grp {
    container foo {
      description "desc";
      reference "ref";
    }
  }

  uses foo;
}

while /grp/foo and /foo are distinct objects, their EffectiveStatement.effectiveSubstatements() need to return the same object.

 

 


Generated at Wed Feb 07 20:55:30 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.