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

Define NormalizedBody and specializations

    XMLWordPrintable

Details

    • Improvement
    • Status: Confirmed
    • High
    • Resolution: Unresolved
    • None
    • 14.0.0
    • data-impl
    • None

    Description

      Analysis of a netvirt heap dump is showing that the data tree involved is around 640MiB, with 147MiB (~23%) retained by NormalizedNode implementations (6.5M objects). Each of these is costing typically 24 bytes, with 4 byte alignment shadow - typically containing the identifier and map of children.

      If we eliminate the idea that a NormalizedNode has an identifier, we would save ~49MiB (33% shallow, 13% overall) heap by making these cost typically 16 bytes.

      There are few places where identifier is required, which would have to be changed to carry Map.Entry<PathArgument, NormalizedNode> instead - a change cascading through quite a few interfaces. The most problematic will probably be NormalizedNodeStreamWriter.

      Aside from memory savings, this would solve the interesting problem of DataTree root node (i.e. corresponding to SchemaContext) needing an identifier, which is currently wedged to use SchemaContext.NAME - which can lead to problems with revisions in some cases.

      Consider dropping Identifiable from NormalizedNode, adjusting all users to cope with that.

      Attachments

        # Subject Branch Project Status CR V

        Activity

          People

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

            Dates

              Created:
              Updated: