Skip to content

Time sum to scan sub folders is much longer than scanning parent folder #469

Open
@YuanMSFT

Description

@YuanMSFT

In an example of folder "A" contains sub folder "B" and "C".

Scanning folder "A" recursively took 53 seconds.

Scanning folder "B" recursively took 38 seconds.
Scanning folder "C" recursively took 37 seconds.

The sum to scan sub folder is 22 seconds more than scanning the parent folder.
38+37-53=22.

Activity

ShaydeNofziger

ShaydeNofziger commented on Mar 21, 2016

@ShaydeNofziger

Using the Measure-Command cmdlet, I am seeing similar results.

Folder A:

  • 4 files
  • 40KB
  • Execution time: 24 seconds

Folder B:

  • 4 files
  • 120KB
  • Execution time: 88 seconds

Folder C:

  • 2 folders (Folder A and B)
  • Execution time: 93 seconds

I'm not sure if this is a bug, as there are probably setup/teardown things that are only occurring once when scanning folder C recursively, whereas the setup / teardown is counted twice when summing A's and B's time. But I can confirm the findings.

MironAtHome

MironAtHome commented on Apr 9, 2016

@MironAtHome

Seems to me this indicates out of 53, 38, and 37 second per attempt, 22 were spent somewhere else, but scanning directories. Something like initialization and cleanup.
Is there any way to profile time spent at more granular level?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ShaydeNofziger@YuanMSFT@MironAtHome@SydneyhSmith

        Issue actions

          Time sum to scan sub folders is much longer than scanning parent folder · Issue #469 · PowerShell/PSScriptAnalyzer