[YANGTOOLS-1209] Track substatement independence in StatementContextBase Created: 20/Jan/21  Updated: 25/Jan/21  Resolved: 25/Jan/21

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

Type: Improvement 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

Issue Links:
Relates
relates to YANGTOOLS-1067 Use flyweight EffectiveStatement impl... Resolved
Epic Link: Parser Performance

 Description   

When we are considering a statement for reuse of EffectiveStatement, we need to consult both the statement itself and its substatements.

The substatement consultation is very rudimentary: we only deal with the case on empty statements and fall back to normal instantiation for everything else.

There is a middle step we can take: if all substatements are CONTEXT_INDEPENDENT or IGNORE, we can reuse all of the substatements, skipping their instantiation.

While this is very similar to the aims of YANGTOOLS-1067, this mechanism should kick in sooner, i.e. when the statement completes EFFECTIVE_MODEL, we can determine the outcome and store it as a single bit. Subsequent (recursive) checks will use this cached value and will apply to all copy operations. YANGTOOLS-1067 then deals with the case when all substatements (including  nominally non-reusable DECLARED_COPY) determine they can be reused for a particular copy operation (on a case-by-case basis).


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