• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openconfig / ygot / 40756473607
89%
master: 89%

Build:
Build:
LAST BUILD BRANCH: robjs-optimise-orderedmap-walk
DEFAULT BRANCH: master
Ran 28 Oct 2026 07:48PM UTC
Jobs 1
Files 85
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Oct 2026 07:40PM UTC coverage: 88.847% (+0.07%) from 88.775%
40756473607

Pull #1121

github

robshakir
ytypes, util: optimise ValidateLeafRefData traversal and memo allocations

`ytypes.ValidateLeafRefData` previously traversed schema-only `nil` branches,
allocated a `PathQueryMemo` map on every visited node, and allocated a zero
value via `reflect.New` on each `util.IsValueNilOrDefault` scalar check.

Changes:
- **Skip `nil` data branches**: Add `WithSkipNilData` on `util.WalkOptions` and
  enable it in `util.ForEachField` when `in` is a `*util.PathQueryNodeMemo`.
- **Lazy query memo maps**: Initialise `PathQueryNodeMemo.Memo` to `nil` on
  visited nodes and allocate the map lazily in `ytypes.dataNodesAtPath` when
  caching a query result.
- **Zero-allocation default checks**: Replace `reflect.New` in
  `util.IsValueNilOrDefault` with `reflect.Value.IsZero` after the scalar
  type check.
- **Single map-key slice allocation**: Reuse `nn.FieldKeys` in
  `util.walkFieldInternal` and `util.walkDataFieldInternal` instead of calling
  `reflect.Value.MapKeys` repeatedly.
- **Tests**: Add unit tests in `util/reflect_test.go` and a `5%` allocation
  regression test (`TestValidateLeafRefDataPerformance`) in
  `ytypes/leafref_test.go`.
Pull Request #1121: ytypes, util: optimise ValidateLeafRefData traversal and memo allocations

40 of 49 new or added lines in 3 files covered. (81.63%)

2 existing lines in 1 file now uncovered.

14188 of 15969 relevant lines covered (88.85%)

1597.57 hits per line

Uncovered Changes

Lines Coverage ∆ File
7
89.08
-1.66% util/walk.go
2
88.13
2.83% util/reflect.go

Coverage Regressions

Lines Coverage ∆ File
2
87.26
-0.45% ytypes/leafref.go
Jobs
ID Job ID Ran Files Coverage
1 40756473607.1 28 Oct 2026 07:48PM UTC 85
88.85
GitHub Action Run
Source Files on build 40756473607
  • Tree
  • List 85
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #1121
  • PR Base - master (#40608054653)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc