Files
clash-verge-rev/src-tauri
Tunglies 09d05b3f36 perf(backend): skip runtime mapping copies in proxy-port save (#8719)
* perf(feat): share runtime mappings across port-save probes via Arc

Every proxy-port save deep-copied the full runtime Mapping twice (current
and candidate) so the rare post-restart re-probe could retain ownership.
Wrap both in Arc once: the first probe takes refcount clones, the re-probe
moves the same Arcs. Probe inputs are identical mappings and the
spawn_blocking Send + 'static bounds are unchanged.

Measured on a representative 200-proxy/30-group runtime config: one
Mapping clone costs 10,053 allocations / 1.02 MiB; the Arc handoff costs
0 / 0. Both copies per save are gone.

* perf(config): borrow through selected-node persistence closures

record_selected_node and persist_reconciled_selected copied the group,
node and profile strings up-front for the persist_selected_update
closure, including on the no-change early-return path. The closure bound
is FnOnce + Send without 'static (the same shape forget_selected_node
already relies on), so capture &str and &[PrfSelected] borrows instead
and construct owned strings only at the storage points. as_deref
comparisons keep content semantics.

* chore(feat): drop a narration comment on the Arc handoff
2026-11-23 09:23:13 +00:00
..
2025-02-27 03:18:23 +08:00
2024-06-20 13:50:28 +08:00