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

Do not populate namespaces during effective templating

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • None
    • parser

      For the purposes of lazy initialization, we are creating StmtContext objects to present a comparison interface. This path is shared with normal inference copy, hence it ends up calling down to StatementSupport.onStatementAdded().

      That method serves two purposes:

      • populate namespaces
      • provide instance checking for action statements and similar

      Namespaces are completely superfluous, as they will end up being thrown away as the template is not retained (not for very long anyway). At this point there cannot be an inference action against the subtree, as it would have already have happened.

      Skip the callout to onStatementAdded(), or replace it with a different call, so that the effective-template copy is clearly distinguished. This will save us at least two temporary HashMaps – reduce the amount of garbage we produce.

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

              Created:
              Updated: