Incremental check causes per-file network round-trip -- batch it #106

Closed
opened 2026-07-21 16:20:16 +02:00 by TapTap · 1 comment
Owner

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_BATCH message 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.

## 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_BATCH` message 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._
Author
Owner

Fixed in PR #148 — merged into main on 2026-07-29.

Fixed in PR #148 — merged into main on 2026-07-29.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TapTap/FastSync#106