-
Notifications
You must be signed in to change notification settings - Fork 1
Fix ratatui-image 10.0.2 compatibility and performance issues #96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@copilot Opening an input takes forever with these changes, but is much quicker on master. Research if halfblocks could be the issue, or what other changes might affect us in the migration from 0.29 to 0.30 |
Fixed the performance issue in commit 93b5ecf. The problem was that The fix moves the picker creation outside the loop, so it's called once per input view instead of once per thumbnail. This reduces the terminal I/O from O(n) to O(1) where n is the number of thumbnails. The issue was not specific to |
The lag is still present. it is worse when the terminal window is larger |
Fixed in commit 1a224db. The issue was that The new fix caches the The larger terminal window made it worse because:
Both issues are now resolved - the picker is created once and reused throughout the session. |
1a224db to
acd947c
Compare
acd947c to
81d5af7
Compare
Fixes compatibility issues after upgrading ratatui-image from 8.1.1 to 10.0.2, and resolves performance regressions introduced by the migration.
Compatibility Changes
ratatuifrom 0.29 to 0.30 to match ratatui-image 10.0.2 requirementsPicker::from_fontsize()withPicker::halfblocks()Send + Sync + 'staticbounds toBackend::Errorforanyhow::Resultcompatibility with ratatui 0.30's newBackendtraitPerformance Optimizations
Picker::from_query_stdio()call outside thumbnail processing loop to avoid multiple expensive terminal I/O operations per inputPickerinstance inAppstruct to eliminate repeated terminal queries on every input view and auto-refreshThe picker is now created once per application lifetime and reused for all thumbnail operations, eliminating lag when viewing inputs, especially with larger terminal windows.
Testing
-D warningscargo fmt💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.