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

Intern yang.model.api.PatternExpression

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Medium Medium
    • 8.0.0, 7.0.10
    • None
    • model-api, parser
    • None

      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%.

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

              Created:
              Updated:
              Resolved: