Skip to content

perf(ui/interfaces): reduce per-row rate lookups#455

Open
snvtac wants to merge 1 commit into
domcyrus:mainfrom
snvtac:snvtac/398-interfaces-rate-lookup
Open

perf(ui/interfaces): reduce per-row rate lookups#455
snvtac wants to merge 1 commit into
domcyrus:mainfrom
snvtac:snvtac/398-interfaces-rate-lookup

Conversation

@snvtac

@snvtac snvtac commented Jul 7, 2026

Copy link
Copy Markdown

Summary

The Interfaces tab rebuilds one table row per network interface on each render. That row construction previously queried the rate map twice with the same interface_name: once for RX and once for TX.

This reuses one rates.get(&stat.interface_name) result for both rate columns, and borrows the interface name when building the first cell instead of cloning the String. The table contents, sorting, scroll windowing, and scrollbar behavior are unchanged.

Linked issue

References #398.

Verification

Per CONTRIBUTING.md > Code Quality Requirements,
I ran the following locally and they all pass:

  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test --all-features
  • cargo build --release

Additional checks:

  • cargo test -p rustnet-monitor ui::snapshot_tests::interfaces_tab
  • cargo deny check (advisories, bans, licenses, and sources ok; existing duplicate-crate warnings only)

Scope

  • One feature or fix per PR (no unrelated cleanups bundled in)
  • No new dependencies, or rationale provided in the summary above
  • No #[allow(clippy::...)] suppressions, or rationale provided
    (see CONTRIBUTING.md)

AI-assisted contributions

If you used an AI assistant (Copilot, Claude, ChatGPT, Cursor, etc.) to
write any of this code, that is fine, but please confirm:

  • I have read every line I am submitting
  • I ran the verification commands above myself
  • The PR description reflects what the code actually does

Notes for the reviewer

No user-visible output change is intended; the existing Interfaces tab snapshot covers the rendered table after this change.

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