Page MenuHomeVyOS Platform

vyatta-cfg: boot and load are quadratic in the number of values of a tag node
Open, Requires assessmentPublicBUG

Description

Loading a config with a large tag node, such as a prefix-list with many rules, takes time proportional to the square of its size: at boot and on load. A 10,000-rule list made the boot-time config load take 50 minutes.

Root cause.

  • Cstore::add_tag (src/cstore/cstore.cpp) lists every existing value of the tag node, through the session's unionfs-fuse mount, each time it adds a value.
  • The list is used only to enforce a tag limit, and that limit is 0 (off) for almost every node.
  • Adding n values therefore reads about n²/2 directory entries.

Measurements

beforeafter
boot-time load, 10,000-rule list (parser PR 1 installed in both)50 min 13 s37.4 s
load, 4,000 rules474.4 s16.3 s
load, 2,000 rules122.9 s8.6 s

Fix direction. Call get_all_child_node_names only when tlimit > 0, the only case that uses the result. Behaviour is unchanged for nodes with and without a limit.

Details

Version
1.4.5, 1.5.1, rolling-2026-09-30
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)