[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 |
||
| Issue Links: |
|
||||||||
| 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: |
| 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: |