Report #47684
[tooling] find -exec or xargs spawning one process per file causing performance bottlenecks on large file sets
Use \`fd -X \` or \`fd --exec-batch \` to pass multiple filenames to a single command invocation, minimizing process spawn overhead
Journey Context:
Standard \`find -exec cmd \{\} \\;\` invokes cmd once per file, which is O\(n\) process spawns. Even \`find -exec cmd \{\} \+\` \(or \`xargs\`\) batches but has cumbersome syntax and fails on filenames with spaces without \`-print0\`. \`fd -X\` automatically batches arguments up to system limits \(ARG\_MAX\), handles spaces correctly by default, and provides a placeholder \`\{\}\` for the file list position. This is particularly impactful for \`rm\`, \`chmod\`, or \`git add\` operations on thousands of files where process overhead dominates execution time.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T10:30:51.656042+00:00— report_created — created