Files
clash-verge-rev/src-tauri
Tunglies d492e37202 perf(tray): build menu in one main-thread dispatch
Menu APIs always execute on the main thread; called from a worker each
one pays a blocking round-trip (channel + event-loop hop + recv), so
rebuilding a proxy menu issued 200+ such round-trips in a row while the
caller waits, and the cost grows when the event loop is busy with
webview work.

Gather the async inputs (verge/clash/profiles snapshots, proxies and
runtime group order) on the caller's task, then construct every menu
item and attach it inside a single run_on_main_thread closure where
each call runs inline. refresh_proxy_items used the same shape on the
old base; the rebuild path now matches it. Measured on a standalone
tauri bench (5 groups x 40 nodes): a rebuild drops from ~6.2ms to
~1.6ms on an idle event loop and from ~11.4ms to ~1.6ms with the loop
busy (8ms work per 16ms frame).
2026-10-21 06:48:13 +08:00
..
2025-02-27 03:18:23 +08:00
2024-06-20 13:50:28 +08:00
2026-07-27 00:44:53 -07:00
2026-10-09 13:43:50 +08:00