in reply to Re^3: Execution hangs on File::Find
in thread Execution hangs on File::Find

hi, after giving it a little more patience to run & wait, you are indeed correct. it is just "S L O W"... but based on the logging (see below), the "overhead" only occurs on the top folder. as you can see from the logs, it took nearly half an hour for it to start traversing the subfolder. i wonder if any other optimization i can do?..

04-12-2017 05:00:33:917 DEBUG Reached Z: 04-12-2017 05:09:56:199 DEBUG Reached Z:A6C335 04-12-2017 05:09:57:820 DEBUG Reached Z:A6C335/A6C335.4.12 04-12-2017 05:09:58:001 DEBUG Reached Z:A6C335/A6C335.5.09 04-12-2017 05:09:58:182 DEBUG Reached Z:A6C335/A6C335.5.10

Replies are listed 'Best First'.
Re^5: Execution hangs on File::Find
by Eily (Monsignor) on Dec 04, 2017 at 13:34 UTC

    Try "Z:/" rather than "Z:", without the / it searches at the current position on Z: (eg, if you cd to "Z:/A6C335" and search on "Z:", you'll already be inside A6C335). I'm not sure if that can be the problem, but at the very least it will be less confusing. If it's still not better, try adding more logs to find precisely which step is taking time.

Re^5: Execution hangs on File::Find
by jahero (Pilgrim) on Dec 04, 2017 at 14:20 UTC
    ... and this is exactly why I am setting the ${^WIN32_SLOPPY_STAT} in my code. It leads to not openning the file on stat, which can lead to rather significant performance gain.

      hi, but im also testing if the file timestamp is newer than the last execution time. removing stat would not serve that purpose right?

        I don't think this means you have to sacrifice stat. Let's see what docs has to say:

        If this variable is set to a true value, then stat() on Windows will not try to open the file. This means that the link count cannot be determined and file attributes may be out of date if additional hardlinks to the file exist. On the other hand, not opening the file is considerably faster, especially for files on network drives.
        See what I mean?

        I don't know what is stored on that shared drive. Does this seem to be a problem?