Skip to content

[codex] Optimize feed and route sync performance#16

Merged
jcastro merged 3 commits into
mainfrom
codex/deep-cleanup-performance
Apr 27, 2026
Merged

[codex] Optimize feed and route sync performance#16
jcastro merged 3 commits into
mainfrom
codex/deep-cleanup-performance

Conversation

@jcastro

@jcastro jcastro commented Apr 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Reduces repeated IP parsing and sorting across feed, UniFi, and Omada flows.
  • Skips redundant route payload construction and rollback copies on no-op syncs.
  • Trims state serialization and JSON request overhead for lower CPU, memory, and wire payload size.
  • Adds regression coverage for IP sorting, UniFi no-op planning, and state tuple persistence.

Measurements

  • UniFi no-op plan with 8,192 IPs: ~321 ms / ~8 MiB peak before, ~1.18 ms / ~129 KiB peak after.
  • parse_ip_list with 8,192 lines: ~111 ms before, ~74 ms after.
  • Omada route flatten of 256 groups x 32 networks: ~260 ms before, ~47 ms with cached destinations.
  • load_feed_snapshot with 12,288 Hayahora entries: ~77 ms before skipped status work, ~37 ms after.
  • State snapshot conversion with 1,000 MACs: ~0.753 ms / ~17.6 KiB peak before, ~0.001 ms / ~0.8 KiB peak after.

Validation

  • git diff --check
  • python3 -m compileall -q src tests
  • python3 -m unittest -q (155 tests OK)

ruff and mypy could not be run because those modules are not installed in this Python environment.

@jcastro jcastro merged commit 74f8ed3 into main Apr 27, 2026
10 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.

1 participant