diff options
| author | Alex Kudentsov <43482574+alexk37@users.noreply.github.com> | 2026-10-01 23:06:45 +0700 |
|---|---|---|
| committer | Alex Kudentsov <43482574+alexk37@users.noreply.github.com> | 2026-10-01 23:06:45 +0700 |
| commit | 6a7cc74c48f0ce021b4c84cb7412683a9c0e9ae8 (patch) | |
| tree | 8c19776a2c51b311bd96fcdcf68b0c49aa04aa8d /python | |
| parent | dfe2203a7fe7fa24de3fa2d8e82fa85dbb0eba52 (diff) | |
| download | vyos-1x-6a7cc74c48f0ce021b4c84cb7412683a9c0e9ae8.tar.gz vyos-1x-6a7cc74c48f0ce021b4c84cb7412683a9c0e9ae8.zip | |
policy: T9379: prefix-list duplicate check in linear time
verify() looked up each prefix-list rule in a list of the rules seen
so far, which is quadratic in the size of the list and runs on every
policy commit. verify() alone, run from the source on a workstation,
took 41.8 s for a 40,000-rule list; on a 1.5.1 VM the check cost 0.08 s
at 2,000 rules.
Keep a set of the rules' sorted items instead. Every value under a
prefix-list rule is a single leaf, so the key is hashable, and two keys
are equal exactly when the rule dicts are: the same rules are flagged,
with the same message. The workstation benchmark took 0.11 s.
Diffstat (limited to 'python')
0 files changed, 0 insertions, 0 deletions
