Repository navigation
perf: harden runtime state and trim hot paths - #128
Merged
Merged
Conversation
Dark mode now overrides secondary and status text, the primary button and destructive text use darker tokens, the rule input has a label, and the delete control has a 24px target.
Restore checks every networksetup call and keeps the snapshot on failure, surfacing the reason after disconnect. Reclaim fails when a leftover core survives SIGKILL instead of claiming its ports are free. A poisoned operation lock no longer blocks every later operation, a failed system proxy sync stays visible in health, the previous core log survives a restart, and the app log reopens after another process rotates it.
Group membership resolution no longer writes a warning per missing pin on every frame; compile reports missing pins instead. Membership, via choices, delay lookup, and the GLOBAL list use hashed lookups, via menus build their choices only when opened, and health polling stops cloning and reloading the strategy it never read. A deleted or unreadable strategy.json is reported instead of being retried or replaced with defaults.
Keep one open file descriptor on a private serial queue, reopen it when the Rust side rotates the log, and keep flock around each append. Relay distribution metrics become debug-only and are skipped unless developer logging is on; the ring copies sources under its lock and aggregates outside it.
Data paths now only stamp activity; a single dispatch timer re-arms for the remaining interval instead of scheduling a work item per chunk. A Mihomo SOCKS connection that enters waiting fails at once and takes the existing fallback, since the loopback listener cannot recover.
Oversized, over-budget, unconvertible, unroutable, and failed-destination datagrams are dropped and counted instead of closing the whole flow. Rejected destinations are kept as records; a socket with only rejected destinations still ends immediately. Idle conversations share one session timer, and a session with no destination for the idle interval finishes so its admission slot returns.
Normalize the hostname, derive suffix candidates, and resolve the executable name once per flow instead of per rule; skip empty suffix indexes and store wildcard pattern characters at construction.
…lies The UDP admission-failure path now closes the claimed flow even when its activity record is gone. The host activity bridge locks its result box so a reply that arrives after the timeout is discarded safely.
harryisfish
force-pushed
the
perf/runtime-robustness
branch
from
November 16, 2026 18:19
62be7b3 to
68731b7
Compare
Popup and background scripts had no preflight scope, so changes under browser-extension/ could not be accepted. A syntax check is the only build-free signal they have.
Record a system proxy sync failure after the health reset so it stays visible, including after automatic recovery. When a leftover core survives, finish resetting runtime flags and the restore note before returning the error. Skip network services that no longer exist when restoring the system proxy. Stop a UDP session drop from overwriting the parent activity once its own conversation has reported.
A successful recovery resets health, which dropped the sync error it had just recorded, and a recovery note hid it. Keep the error across resets and append it to any note. Treat services macOS has disabled as still present when restoring, so their proxy settings are not abandoned.
Keeping the sync error across health resets also carried it into the next connect attempt and past a successful restore. Clear it when a connect starts and when disconnect restores the system proxy.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal
Improve runtime robustness and rendering performance based on a read-only review of the controller, the GPUI window, the System Extension, and the browser extension popup.
Scope
Verification
Owner: @harryisfish
Status: verified, ready for review.