Skip to content

perf(mirrors): skip unchanged scans and empty range batches - #676

Merged
nixuuu merged 1 commit into
devfrom
perf/idle-thread-mirrors
Nov 13, 2026
Merged

nixuuu merged 1 commit into
devfrom
perf/idle-thread-mirrors

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 13, 2026

Copy link
Copy Markdown
Member

Caught-up thread mirrors performed an empty range read and durable ACK every five seconds. Use the existing heartbeat instead, and reuse the thread-head snapshot until the owner replication clock changes. Real batches retain the single outstanding batch, 64-record/64 KiB limits and ACK-after-commit contract. Debouncing those ACKs would stall this flow-control protocol.

Fixes: #539

Paired local workload on dev 7137e9a: two linked desktop gateways, desktop SSE plus mobile Connect simulation, 12 idle threads each, diagnostics enabled, 5 s warmup then 30 s. Measured independently of the shared-cache fix in #675. The measurement harness is in #675; use the identical harness against both revisions.

Diagnostics counter, 30 s Before After
AckThreadRange, A / B 6 / 6 0 / 0
Database queries, A / B 2,910 / 2,623 2,470 / 2,410
Unclassified queries, A / B 210 / 150 126 / 90
GetComputers, A 12 0
Foreground WatchThread openings during window 0 0

The GetComputers reduction follows removal of idle mirror commits; #675 also handles repeated presence during actual updates. Active ACK rates depend on real writes and retain the existing batching cadence. These idle numbers are not a throughput claim.

Validation: check:tmp on thread-ranges (10 passing tests, including new idle heartbeat assertion, lost ACK/restart, ownership, gap repair, batch limits, live metadata and healthy unary); thread-range-move-controls; paired workload and cleanup; full typecheck; focused lint/format. Install, generation, full lint/format and web build were also checked in this task against the same dev base. Full local check:tmp is deferred to CI because unrelated heavy suites already load the host. No mobile/native code or fingerprint changes; device host remains unavailable.

@nixuuu
nixuuu marked this pull request as ready for review November 13, 2026 23:05
@nixuuu
nixuuu merged commit 150933e into dev Nov 13, 2026
10 checks passed
@nixuuu
nixuuu deleted the perf/idle-thread-mirrors branch November 13, 2026 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant