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

Use flyweight EffectiveStatement implementations

XMLWordPrintable

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

      Most EffectiveStatement subtrees are inlined via grouping/uses mechanics, which we gain control of via YANGTOOLS-694.

      Since most effective statements have a SchemaPath, their state depends on it and thus we cannot reasonably share state – this property cascades to parent substatement list – hence we can share very little.

      Once we get rid of SchemaPath, though, each effective statement's state is (mostly?) dominated by its QName (which dictates substatements' QNames, etc.), hence we can deploy a very efficient flyweight pattern, where we maintain a QNameModule -> template cache and aggressively reuse effective statements.

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

              Created:
              Updated:
              Resolved: