Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-1209

Track substatement independence in StatementContextBase

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Medium Medium
    • 7.0.0
    • None
    • parser
    • None

      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).

            rovarga Robert Varga
            rovarga Robert Varga
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: