pkolaczk / fclones

Efficient Duplicate File Finder
MIT License
1.87k stars 70 forks source link

Make generating dedupe script parallel again #140

Closed pkolaczk closed 2 years ago

pkolaczk commented 2 years ago

Dedupe script generation was changed to single-threaded in one of an earlier commits in order to fix the ordering of the commands printed in --dry-run.

Unfortunately this caused a performance degradation because the script generation involves a significant amount of I/O. The script generation could not keep up with the pace at which multiple threads can process the commands, and those threads were heavily spinning waiting for work.

This commit reverts that change and implements the ordering of items in a different way. Now all FsCommands are sent to a PriorityQueue which puts them back in the correct order.

Fixes #138