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
There is noticeable latency when switching between multiple inbox representations. You can see this where when switching between the inbox for 2 different accounts it takes around 300 - 500 ms for the selected inbox highlight to finish updating and if the refreshing spinner is activate at that time it will also pause for the duration.
I worked a little this morning on this and was able to decrease the latency between inboxes with large amounts of mail down by about 180ms. Im building a beta version with this fix included, let me know if it improves your situation any. It should be in the repo shortly
3. The pause is improved to the point where I don't find it jarring but there are probably several frames that get skipped.
There are a few things happening here that gives the impression of this Freeze. I'll try to explain them.
UI Animation Starvation: GTK4 spinners and transition states run on the same layout rendering pass. When a heavy, non-yielding processor cycle is executed, it halts the progress bar pulse updates, creating that distinct visual "freeze". Instead of completely nuking the folder's visible hierarchy on every click, the app now retains the existing row elements. It simply swaps out the text and profile variables inside them dynamically. The repository owner has already pushed a performance fix (commit 33080d3) specifically targeting the widget allocation lifecycle
Issue Update: Resolving the Inbox Switching UI Jank (#401)##
Why It Happens: The Technical Reality
The noticeable 300–500ms transition latency and frozen animation spinners encountered when switching between mailboxes are caused by a classic architectural bottleneck: UI thread starvation.
Because Hylki is built using Rust, GTK4, and libadwaita, it relies on a single main application loop to manage interface interactions, process widget transformations, and render UI frame animations. When a you switched folders, the application is performing heavy operations synchronously directly on this main thread. The system temporarily stops processing the rendering pipeline to compute the changes, forcing the progress spinner to freeze and frames to drop.
Why This Is Challenging to Implement
Achieving instantaneous, seamless mailbox loading across highly populated accounts is an intricate engineering task for several reasons:
The Cross-Framework Bridge (Tokio vs. Gio): Hylki effectively runs two concurrent loop engines. A high-performance async back-end (Tokio) handles disk access and network streams, while a localized event loop (Gio) manages UI state updates. Ensuring database query pools smoothly offload data across this asynchronous boundary without blocking the GUI requires complex, thread-safe synchronization memory maps.
Widget Allocation Churn: In traditional setups, switching folders forces the application to completely destroy the existing UI list items and allocate hundreds of new objects from scratch. Spawning massive quantities of custom AdwActionRow or nested box elements simultaneously places heavy stress on the GTK builder pipeline, resulting in noticeable animation lag.
Database Lookups vs. Interface Frames: In common-rail local data configurations, parsing conversation trees, checking read/unread message totals, and sorting metadata scales exponentially with mailbox size. If a single lookup operation delays execution by even 16 milliseconds, the desktop environment will drop a frame.
What the Developer Can Do to Optimize Performance
The recent optimization profile (commit 33080d3) successfully addressed the widget allocation issue by retaining and recycling existing row containers rather than rebuilding them, reducing transition delay by roughly 180ms.
To completely bridge the gap and achieve enterprise-grade responsiveness, the development workflow can implement these three target optimizations:
The main interface thread should never touch the storage disk or execute raw database queries.
All heavy operations—such as retrieving message index tables or rebuilding conversation threads—must be completely isolated inside non-blocking background worker channels using Tokio handles.
The interface loop should instantly return control back to the layout pipeline, utilizing thread-safe cross-beam communication (std::sync::mpsc) to progressively stream content fields via Gio channels only as they become available in system memory.
2. Advanced SQLite Data Indexing & WAL Allocation
Optimize the underlying database access layer to bypass heavy tables lookups entirely during standard folder navigation:
Covering Indexes: Implement strict compound database index strategies optimized for mailbox layout structures:
CREATE INDEX idx_mail_folder_date ON messages(folder_id, date_received) INCLUDE(subject, sender_name, snippet);
This enables the system to pull vital message arrays directly out of the lightweight, pre-sorted index tree, skipping disk lookups on the main table.
Write-Ahead Logging: Force the storage loop to execute under PRAGMA journal_mode=WAL;. This unlocks continuous background email indexing streams without blocking simultaneous read requests from user inputs.
3. True Data Virtualization (Infinite List Scrolling)
Even with row recycling, managing thousands of active data nodes behind the scenes introduces memory pressure.
Adopt full data virtualization within the GTK4 list view structure. The layout should only allocate physical memory and process widgets for the 15 to 20 emails visible on screen at any given moment.
As the user scrolls through the folder, the engine dynamically updates those exact same visual containers on the fly with text variables pre-fetched from a localized RAM buffer array (Vec).
You know what, I got the day off I might fork this and build it for something to do since I spent an hour writing this, I practically know how to implement it 🪓
Activity
perf(list): keep the rows when switching folders (#401)
hyprlab commentedon Oct 10, 2026
I worked a little this morning on this and was able to decrease the latency between inboxes with large amounts of mail down by about 180ms. Im building a beta version with this fix included, let me know if it improves your situation any. It should be in the repo shortly
rzeigler commentedon Oct 11, 2026
The pause is improved to the point where I don't find it jarring but there are probably several frames that get skipped.
narcarsiss commentedon Oct 11, 2026
There are a few things happening here that gives the impression of this Freeze. I'll try to explain them.
UI Animation Starvation: GTK4 spinners and transition states run on the same layout rendering pass. When a heavy, non-yielding processor cycle is executed, it halts the progress bar pulse updates, creating that distinct visual "freeze". Instead of completely nuking the folder's visible hierarchy on every click, the app now retains the existing row elements. It simply swaps out the text and profile variables inside them dynamically.
The repository owner has already pushed a performance fix (commit 33080d3) specifically targeting the widget allocation lifecycle
Issue Update: Resolving the Inbox Switching UI Jank (#401)##
Why This Is Challenging to Implement
What the Developer Can Do to Optimize Performance
1. Decoupled Asynchronous Database Query Pipelines
2. Advanced SQLite Data Indexing & WAL Allocation
CREATE INDEX idx_mail_folder_date ON messages(folder_id, date_received) INCLUDE(subject, sender_name, snippet);
This enables the system to pull vital message arrays directly out of the lightweight, pre-sorted index tree, skipping disk lookups on the main table.
3. True Data Virtualization (Infinite List Scrolling)
You know what, I got the day off I might fork this and build it for something to do since I spent an hour writing this, I practically know how to implement it 🪓
hyprlab commentedon Oct 11, 2026
@narcarsiss thank you for this! Yes please feel free to fork and PR, greatly appreciate it!
hyprlab commentedon Oct 15, 2026
Agentic reply:
The build is in the repo now:
flatpak updatepicks it up.