Skip to content

Add performance benchmarks for large configurations#214

Merged
jtdub merged 4 commits intomasterfrom
issue202
Mar 20, 2026
Merged

Add performance benchmarks for large configurations#214
jtdub merged 4 commits intomasterfrom
issue202

Conversation

@jtdub
Copy link
Contributor

@jtdub jtdub commented Mar 20, 2026

Summary

  • Closes Add performance benchmarks for large configurations #202: Add 10 performance benchmark tests covering:
    • Parsing: get_hconfig and get_hconfig_fast_load with ~10,000-line IOS and XR configs
    • Remediation: config_to_get_to with small diff (10%), large diff (100%), and completely different configs
    • Iteration: all_children_sorted, dump_simple, and deep_copy on large trees
  • Benchmarks are skipped by default via pytest.mark.benchmark marker with addopts = "-m 'not benchmark'" in pyproject.toml
  • Run benchmarks with: poetry run pytest -m benchmark -v -s

Benchmark Results

Benchmark Config Size Best Time
Parsing
get_hconfig (IOS) 8,430 lines 0.145s
get_hconfig (XR) 10,008 lines 0.261s
get_hconfig_fast_load (IOS) 8,431 lines 0.135s
fast_load vs get_hconfig ratio 1.1x faster
Remediation
10% diff 1,000 interfaces 0.032s
100% diff 1,000 interfaces 0.061s
Completely different configs 500 interfaces each 0.037s
Iteration
all_children_sorted 7,423 nodes 0.004s
dump_simple 7,423 lines 0.013s
deep_copy 7,423 nodes 0.029s

Test plan

  • poetry run pytest -m benchmark -v -s — all 10 benchmarks pass
  • poetry run ./scripts/build.py lint-and-test — full suite passes (benchmarks excluded by default)

🤖 Generated with Claude Code

jtdub and others added 4 commits March 19, 2026 21:30
Add 10 benchmark tests covering parsing, remediation, and iteration
performance with 500-interface configs. Benchmarks are skipped by
default via pytest marker; run with: poetry run pytest -m benchmark -v -s

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Increase default config generators to 1000 interfaces (~10k lines).
Add benchmark execution and analysis guidance to CLAUDE.md.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ocstring

- Remove unused _TARGET_LINES constant
- Relax fast_load_vs_get_hconfig assertion to allow 10% CI variance
- Fix docstring: 50/1000 interfaces is ~5%, not ~10%

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jtdub jtdub merged commit c74ac20 into master Mar 20, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add performance benchmarks for large configurations

1 participant