[YANGTOOLS-1374] Intern yang.model.api.PatternExpression Created: 03/Dec/21  Updated: 03/Dec/21  Resolved: 03/Dec/21

Status: Resolved
Project: yangtools
Component/s: model-api, parser
Affects Version/s: None
Fix Version/s: 8.0.0, 7.0.10

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

Epic Link: Parser Performance

 Description   

After addressing YANGTOOLS-1067 we are pretty much in a place where we have squeezed pretty much all generic memory efficiency.

Examining the heap dump from a Junus 19.3 model run, we still have a rather large number of duplicate objects, but these seem to be coming from duplication inherently present in the model sources.

There is a single outlier, which is PatternExpression – these are immutable String holders, for which which one of the strings comes from models, and thus is already deduplicated by our IR parsing pass. The second String is the adjusted Pattern string, which we derive.

Improve the situation by interning PatterExpressions, reducing memory footprint in this particular use case by about 2%.


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