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

Reconsider AbstractPathArgument hashCode()

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Medium
    • Resolution: Done
    • None
    • 2.1.11, 3.0.2
    • None
    • None

    Description

      Single-byte hashCodeGuard has not-so-nice effects in NodeWithValue and NodeIdentifierWithPredicates, causing them to have 7 bytes worth of padding per instance. Even NodeIdentifier has a 3/7 byte padding.

      Eliminating hashCodeGuard in favor of treating hashCode == 0 as not present will have the effect of eliminating most of the padding:

      NodeIdentifier goes from 24/32 bytes to 24 bytes, saving 8 bytes in the 64bit case.

      NodeWithValue and NodeIdentifierWithPredicates go from 32/40 bytes to 24/32 bytes, saving 8 bytes for every case.

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: