[YANGTOOLS-1497] Improve NamespaceBehaviour/NamespaceStorageNode interactions Created: 05/Apr/23 Updated: 06/Apr/23 Resolved: 06/Apr/23 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | parser |
| Affects Version/s: | None |
| Fix Version/s: | 11.0.0 |
| Type: | Improvement | Priority: | High |
| Reporter: | Robert Varga | Assignee: | Robert Varga |
| Resolution: | Done | Votes: | 0 |
| Labels: | pt | ||
| Σ Remaining Estimate: | Not Specified | Remaining Estimate: | Not Specified |
| Σ Time Spent: | Not Specified | Time Spent: | Not Specified |
| Σ Original Estimate: | Not Specified | Original Estimate: | Not Specified |
| Issue Links: |
|
|||||||||||||||||||||||||
| Sub-Tasks: |
|
|||||||||||||||||||||||||
| Epic Link: | Parser Performance | |||||||||||||||||||||||||
| Description |
|
As examined in At the end of the day, for any ParserNamespace operation, we have to find its NamespaceBehaviour and then execute the request using that behaviour. There is a connection between these operations, at least in the yang-parser-reactor implementation. The story goes something like this:
The behaviour count breaks down as follows:
The yang-parser-reactor implementation essentially requires a walk to BuildGlobalContext to acquire NamespaceBehaviours, which it wraps with extended implementations (Simple/VirtualNamespaceContext) – hence these implementations are primed to have a quick way to access the GLOBAL node. Furthermore RootStatementContext has a direct pointer to SourceSpecificContext and that has a direct pointer to BuildGlobalContext. Based on these implementation specifics, there seems to be an opportunity to knock off at least the global() case in that we would memoize BuildGlobalContext reference in NamespaceContexts – and then we just need to provide a mechanism for them to provide access to it to their respective NamespaceBehaviours. This will provide immediate benefits to major users:
as these will not have to walk the statement tree again to reach BuildGlobalContext. While there may be other opportunities, this issue should focus on:
|
| Comments |
| Comment by Robert Varga [ 06/Apr/23 ] |
|
|