http://qs321.pair.com?node_id=1211132


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.
  • Comment on Re: Perl Program to efficiently process 500000 small files in a Directory (AIX)

Replies are listed 'Best First'.
Re^2: Perl Program to efficiently process 500000 small files in a Directory (AIX)
by LanX (Saint) on Mar 17, 2018 at 13:59 UTC
    Thumbs up, exactly the points I wanted to make.

    Improvement is only possible after identifying the bottlenecks, and who knows how performant single file moves are on AIX ...

    > 80,000 files per hour. 

    Means about 4 per second that's hard to believe on modern hardware.

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Wikisyntax for the Monastery

      80,000/hr /3600 = 22.222/s?


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
      In the absence of evidence, opinion is indistinguishable from prejudice. Suck that fhit
      Well I can assure you that you can believe it. Remember there are around 1million files dropped into this directory each day. Of these 1 million around half are the files I'm looking for to move into another directory. I commented out the "Move" out of the above script on this thread and it ran in 1 hour and 20 minutes
Re^2: Perl Program to efficiently process 500000 small files in a Directory (AIX)
by Anonymous Monk on Mar 19, 2018 at 03:02 UTC
    Mike, I'm curious why you post your better, less provocative stuff anonymously. It leads one to surmise that you are intentionally trolling when you post as sundialsvc4.
      Its still the same ol same ol, hes just repeating/restating things already said by others before him
      Quite the opposite. I use AM more and more frequently just to piss seven people off. :-P

      If you liked the previous post, then its reputation would be only -6 instead of -7, and that gets tiresome after a while.