[YANGTOOLS-218] Eliminate QName.getPrefix() Created: 17/Jul/14  Updated: 10/Apr/22  Resolved: 08/Jan/15

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: None
Fix Version/s: None

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

Operating System: All
Platform: All


Issue Links:
Blocks
blocks YANGTOOLS-361 Milestone: Decrease Technical Debt fr... Resolved

 Description   

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.



 Comments   
Comment by Martin Vitez [ 29/Jul/14 ]

Proposed patch:

https://git.opendaylight.org/gerrit/9390

Comment by Martin Vitez [ 18/Aug/14 ]

Use of QName.getPrefix() removed from yang-parser-impl.

Comment by Ladislav Borak [ 08/Sep/14 ]

Will be resumed after release

Comment by Robert Varga [ 31/Oct/14 ]

Preliminary patch, needs to be finished:

https://git.opendaylight.org/gerrit/12397

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