[YANGTOOLS-693] Parser: duplicate TypeStatementImpl objects Created: 18/Oct/16  Updated: 05/Apr/23  Resolved: 21/Oct/16

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Highest
Reporter: Robert Varga Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issue Links:
Blocks
is blocked by YANGTOOLS-660 SchemaContext - excessive memory cons... Resolved
Epic Link: Parser Performance
External issue ID: 6965

 Description   

Analysis of a memory snapshot with vendor models shows we end up with a SchemaContext which weighs about 240MB. Further analysis of duplicate objects shows we have ~12000 instances of TypeStatementImpl wasting ~2MB, which refer to simple yang types:
argument&rawArgument == "string", "uint32", etc.
source == DECLARATION
definition == TYPE
substatemebts == ImmutableList.of()

Pre-allocate instances for all YANG basic types (e.g. not decimal64 and similar) and make sure to squash these duplicates to singleton instances.



 Comments   
Comment by Robert Varga [ 20/Oct/16 ]

carbon: https://git.opendaylight.org/gerrit/47217

Comment by Robert Varga [ 21/Oct/16 ]

boron: https://git.opendaylight.org/gerrit/47323

Generated at Wed Feb 07 20:54:01 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.