Refactor ListEffectiveStatementImpl 57/86857/18
authorRobert Varga <robert.varga@pantheon.tech>
Sun, 12 Jan 2020 18:12:09 +0000 (19:12 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 14 Jan 2020 13:22:18 +0000 (14:22 +0100)
commitfb9318d77d36a605497c3d12a5fc602a0ed2265f
tree26e07ce38a5e8d820357b8ff8850b2362a8c7f8f
parent59f98cbf8ef79ecab8ee6d7c5141704142b0f40a
Refactor ListEffectiveStatementImpl

ListEffectiveStatement implementation is immensely big -- it takes
anywhere between 112 and 224 bytes (120 typical), most of which are
really only indices on substatements, which we can construct on demand.

Applying mixin + layout classes here allows us to drop the size of
these statements to 40/48 bytes typical, with 88 bytes worst case.

The effect on retained memory is ~12% memory foot print reduction,
driven by both reduction of number of ImmutableSets and reduced object
size.

JIRA: YANGTOOLS-1065
Change-Id: Iebcf16b500a874dff94bb21b6f9f59bf056fea51
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/AbstractDeclaredEffectiveStatement.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/AbstractSchemaEffectiveDocumentedNode.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/EffectiveStatementMixins.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/EffectiveStmtUtils.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/list/AbstractListEffectiveStatement.java [new file with mode: 0644]
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/list/AbstractListStatementSupport.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/list/EmptyListEffectiveStatement.java [new file with mode: 0644]
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/list/ListEffectiveStatementImpl.java [deleted file]
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/list/RegularListEffectiveStatement.java [new file with mode: 0644]