Files
clash-verge-rev/src-tauri
Tunglies a85640a571 perf(backend): trim redundant copies on service IPC paths (#8720)
* perf(core): remove redundant copies on service IPC paths

Allocation and copy trims on the service IPC hot paths; the wire format
is untouched:

- store the owner session proof as Arc: active_service_session()
  retrieval becomes a refcount clone instead of a 64-char string copy
  per call (~12 call sites, including the frontend-polled log path).
  The one external caller takes Proof: Borrow<OwnerSessionProof> so its
  four test closures stay unchanged.
- build the session token hex with one allocation instead of 32
  format! allocations plus Vec growth (35 -> 1 allocations measured),
  mirroring owner_identity::encode_token.
- reuse one RuntimeFileRequest across the provider cache-sync chunk
  loop; only .offset changes per chunk.
- move the proposed session token out of StartClashRequest on success
  instead of cloning it up-front.
- report the non-actionable service status by reference before
  set_status takes ownership.
- hoist the macOS install markers to LazyLock, pass osascript args as
  an array, compare the install-wait core name via the requirement
  array, and log the silent-updater version by reference.

* fix(core): gate the LazyLock import to macOS

The install-marker static is the only LazyLock user in the module and
is macOS-gated; the ungated import made clippy -D warnings fail the
Linux and Windows builds. Co-locate the import with its cfg.
2026-11-23 09:11:58 +00:00
..
2025-02-27 03:18:23 +08:00
2024-06-20 13:50:28 +08:00