Incremental check causes per-file network round-trip -- batch it #106
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
incremental_check()sends one request per file and waits for a reply. For millions of small unchanged files, this adds a full network round-trip per file. On high-latency links this destroys throughput.Location
src/client/client_send.c:25-62 (incremental_check)
src/shared/file.c:442-560 (receive_incremental_check)
Current behavior
Client sends STATUS_CHECK + (path, size, mtime) per file. Server replies STATUS_OK (unchanged) or STATUS_NEXT (send file). For 1M unchanged files on a 100ms RTT link, this takes ~28 hours of round-trips.
Suggested Fix
Batch incremental checks: design a
STATUS_CHECK_BATCHmessage type that sends an array of (path, size, mtime) tuples and receives a bitmap of which files changed. This reduces the O(n) round trips to O(1).Expected impact
On high-latency links, batching could reduce incremental check time from hours to seconds.
Severity
high
Category
performance
Sub-Agent
perf-analyst (PA-1)
This issue was automatically generated by the issue-creator agent.
Fixed in PR #148 — merged into main on 2026-07-29.