mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-23 21:12:28 +08:00
* perf(profile): stabilize profile grid callbacks and context menus ProfileItem is memoized, but the grid passed five freshly-created closure props per render, so URL keystrokes and switch spinners re-rendered every card. The callbacks are now uid/item-parameterized stable handlers, and the context-menu label map and item literals are hoisted or gated on the menu being open. * perf(profile): derive editor policy names and dedupe pasted proxies The groups editor re-read both profile files and re-parsed three YAML documents on every prepend/append/delete edit. The origin names are now read once per open and folded into a memoized policy list, and batch pasted proxy names dedupe through a Set instead of a linear scan. * perf(ui): keep mutateVerge identity stable across renders mutateVerge was a per-render closure that dozens of consumer callbacks depended on, and its updater fell back to a render-time config snapshot. It now keeps a stable identity, revalidates through the module-level query helper, and passes the live cache value (preload snapshot when the cache is still empty) to function updaters; object-form callers were migrated to updater functions. * perf(ui): hoist static dialog identities and memoize settings search The DNS viewer rebuilt Monaco's options object per keystroke, the update dialog rebuilt its markdown component map and plugin array per progress chunk (remounting link and blockquote subtrees), and the settings search rescanned the ~180-entry catalog on unrelated renders such as arrow-key selection. These identities are now module constants or single memos; the width-dependent minimap option is applied at editor mount. * perf(proxy): stable tool callbacks and shared delay entries Group headers and heads passed freshly-created closures into the memoized tools, defeating it on every render; the tool callbacks are now groupName-parameterized and forwarded directly. Cached delay entries are write-once, so the defensive copy on read and the second copy in the delay-state reducer were dropped. * perf(proxy): stable group location and chain list identities The sticky-header scroll callback depended on the render list identity, re-creating the item renderer on every list rebuild; it now reads the list through a stable ref callback. Rebinding no longer allocates new chain items and arrays when values are unchanged, so the 15s proxy-view refresh stops re-serializing identical chains to localStorage, and the chain delay key join is memoized. * perf(log): reuse the empty logs fallback identity A fresh [] fallback gave the subscription hook's refresh callback and snapshot effect a new identity on every render while logs streamed; the empty list is now a shared module constant. * perf(home): build traffic range snapshots in one pass The 200ms graph snapshot built three to four intermediate arrays on the compressed path before posting to the worker. It now fills one preallocated result in a single pass and only sorts when the compressed and raw ranges actually interleave. * chore(changelog): drop the render efficiency entry