Skip to content

Improve performance script analyzer #247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 18, 2015

Conversation

quoctruong
Copy link

No description provided.

Dictionary<string, List<RuleSuppression>> ruleSuppressions;
List<Regex> includeRegexList;
List<Regex> excludeRegexList;
CountdownEvent cde;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to initialize an initial count ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh i don't need that countdownevent actually. Forgot to remove it. Updated!

@yutingc
Copy link
Contributor

yutingc commented Jun 18, 2015

Otherwise, looks good to me.

@raghushantha
Copy link
Member

Quoc. Can you summarize the changes here? Need this for the release notes

suppressed.AddRange(records.Item1);
List<object> result = new List<object>();

//WriteVerbose(string.Format(CultureInfo.CurrentCulture, Strings.VerboseRunningMessage, scriptRule.GetName()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove commented code

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

@quoctruong
Copy link
Author

Improve the performance of PSScriptAnalyzer by running the default rules in parallel using System.Threading.Task. It is important to note that any rules that use powershell.invoke cannot be run in parallel using this method (hence why we only apply it to the default rules).

@raghushantha
Copy link
Member

looks good. Do you know how long the test pass takes with/without the changes?

@quoctruong
Copy link
Author

It's only 2 or 3 seconds faster because the tests run small scripts (which means that the improvement from running the rules in parallel won't be noticeable). If you run this with the DoPx module of Kirk for example, then it is almost twice as fast (same if we run on a long script like PSGet.psm1 where it can be 3 or even 4 times faster).

@quoctruong
Copy link
Author

Merged the changes.

quoctruong pushed a commit that referenced this pull request Jun 18, 2015
@quoctruong quoctruong merged commit dc59597 into BugFixes Jun 18, 2015
@quoctruong quoctruong deleted the ImprovePerformanceScriptAnalyzer branch June 18, 2015 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants