in reply to Perl Program to efficiently process 500000 small files in a Directory (AIX)
It would be instructive to comment-out various parts of the program to see exactly which one is slowing you down most – walking the directory, reading the content, or moving the file. It could possibly be that directory manipulation or directory walking is the culprit, such that things might move faster if your program stashed a list of files that need to be moved, then moves them after completing all or part of the walk. It could also be that memory-mapped files could help. You have several I/O operations here any one of which could be the bad(dest) guy.