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

Eliminate QName.getPrefix()

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Done
    • None
    • None
    • None
    • None
    • Operating System: All
      Platform: All

      In a minimalistic system, we typically have around 100K QNames, each of which carries a "prefix" which is tied to the namespace specified in the QNameModule.

      The problem is that this prefix is only needed on encoding edges: when parsing YANG files and producing/parsing XML files. For XML this mapping is covered by javax.xml.namespace.NamespaceContext. For YANG parsing we need the equivalent.

      When the QName is used internally in the system, it should not lug the prefix around.

      Implementing this will immediately shed 4 bytes off of each QName, saving 400KB from shallow usage. Further savings will come from not retaining the strings.

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

              Created:
              Updated:
              Resolved: