You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Invoke-PSScriptAnalyzer performance is very, very poor #197
Even for modules that contain a small number of commands (44 for one of my modules), Invoke-PSScriptAnalyzer is way too slow. When I ran it recursively on that module folder, it took just under 2 minutes (1 minute, 53 seconds) to perform the analysis. That's just horrible. Imagine a module that has 100+ commands? Please consider how you might take advantage of multiple threads/processes/jobs, or reducing the amount of redundant AST work that is being performed across similar rules to improve performance.
I find myself wondering if rules could be designed to plug into a single AST walkthrough instead of having each rule do its own AST searching/processing. Perhaps the notion of rule sets should be considered in order to permit certain rules to plug into a speedier process tailored to a particular area/feature/subset of PowerShell that is being analyzed. Those are just a few ideas that came to mind when thinking about how to solve this problem, but I imaging a profiling tool would identify at least a few areas where performance could be improved through less redundancy in code.
My DoPx module is where I found the worst performance (it has the largest number of files on the modules I tested). That is the module I was referring to above (where it took 1 minute 53 seconds to perform the analysis).
Activity
raghushantha commentedon May 22, 2015
Thanks for the suggestions, Kirk.
For the first pass we will use Windows Performance Analyzer to make immediate perf improvements.
-Raghu
quoctruong commentedon Jun 12, 2015
Hi Kirk, do you mind providing me with a module where performance is an issue (would be great if you can let us know how long it takes too) ?
KirkMunro commentedon Jun 16, 2015
Hi Quoc,
My DoPx module is where I found the worst performance (it has the largest number of files on the modules I tested). That is the module I was referring to above (where it took 1 minute 53 seconds to perform the analysis).
quoctruong commentedon Jun 16, 2015
Thanks Kirk. We will look into this issue.
quoctruong commentedon Jun 18, 2015
Fixed with #247