Single-threaded BFS scanner is a bottleneck for large directory trees #109

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

Description

The scanner runs in a single thread. For filesystems with millions of files in deep trees, opendir/readdir/lstat per entry is I/O bound and cannot be parallelized.

Location

src/client/scanner.c

Suggested Fix

Use multiple scanner threads each handling different subdirectories (root→queue→workers pattern). Or use fts(3) / nftw(3) which can be faster than manual BFS with opendir/readdir/lstat.

Severity

medium

Category

performance

Sub-Agent

perf-analyst (PA-4)


This issue was automatically generated by the issue-creator agent.

## Description The scanner runs in a single thread. For filesystems with millions of files in deep trees, `opendir`/`readdir`/`lstat` per entry is I/O bound and cannot be parallelized. ## Location src/client/scanner.c ## Suggested Fix Use multiple scanner threads each handling different subdirectories (root→queue→workers pattern). Or use `fts(3)` / `nftw(3)` which can be faster than manual BFS with opendir/readdir/lstat. ## Severity medium ## Category performance ## Sub-Agent perf-analyst (PA-4) --- _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#109