You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add GPU process filter and improve sort stability (#117)
* feat: add GPU process filter and improve sort stability (#114)
Add the ability to filter the process list to show only GPU processes
(those with used_memory > 0) and improve sort stability to prevent
processes from constantly shifting positions during monitoring.
Changes:
- Add gpu_filter_enabled flag to AppState for tracking filter state
- Add 'f' keyboard shortcut to toggle GPU-only process filter
- Apply GPU filter in the render pipeline before displaying processes
- Update status bar to show [Filter:GPU] when filter is active
- Use PID as secondary sort key in process sorting to ensure stable
ordering when primary values are equal
- Update help text to show new filter shortcut and filter status
Closes#114
* fix: resolve GPU filter selection and performance issues
This commit addresses two MEDIUM priority issues in PR #117:
1. Selection Index Inconsistency: Reset selected_process_index and
start_index to 0 when enabling GPU filter to prevent out-of-bounds
errors when the filtered list is shorter than the unfiltered list.
This provides a clean UX by jumping to the top of the filtered list.
2. Memory Allocation Overhead: Use Cow<'_, [ProcessInfo]> pattern to
eliminate unnecessary cloning. When filter is disabled, we now
borrow the process list instead of cloning it, significantly
reducing allocations on every render cycle.
Changes:
- event_handler.rs: Add index reset logic when toggling filter on
- ui_loop.rs: Replace Vec clone with Cow for conditional ownership
- app_state.rs: Auto-formatting changes only
* chore: finalize PR with tests, docs, and lint fixes
- Add comprehensive unit tests for GPU filter functionality
- Add tests for sort stability with PID as secondary sort key
- Update README with new 'f' key for GPU process filter
- Update man page with complete keyboard shortcuts documentation
- Fix clippy warnings in storage module by marking public API items
as allowed unused (used by library consumers, not binary)
0 commit comments