Mark statements as context-insensitive
A number of statements are subject to inlining, but not all of them
are affected by such inlining.
When a substatement is not affected by inlining (and inference
after the fact), we can safely reuse original statement context for
the purposes of representing effective state.
Teach AbstractStatementSupport about the concept of context-independence
and take advantage of it in simple statements. The end result is
fewer instantiated StmtContext objects, reducing peak memory usage.
Since StmtContext instance are shared, we also end up sharing
EffectiveStatement implementations, completely removing duplication
in reference test case -- eliminating ~3.7M objects and trimming
retained size by 56MiB, i.e. 7.8%.
JIRA: YANGTOOLS-694
Change-Id: I2e29ef24cf31ca800de36403037c3af11698a789
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
17 files changed: