Skip to content

Replace StringCollection with generic List - #13431

Closed
xtqqczze wants to merge 6 commits into
PowerShell:masterfrom
xtqqczze:replace-StringCollection
Closed

xtqqczze wants to merge 6 commits into
PowerShell:masterfrom
xtqqczze:replace-StringCollection

Conversation

@xtqqczze

@xtqqczze xtqqczze commented Aug 14, 2020 •

Copy link
Copy Markdown
Contributor

PR Summary

  • Replace StringCollection with List<string>.
  • Replace StringCollection with string[] when length is known.
  • Rename variables for clarity.
  • Refactor GenerateMultiLineRowField as static method.
  • Cache loop invariant integers.

Changes not made in the following:
src\System.Management.Automation\engine\LanguagePrimitives.cs: complex call hierarchy
src\Microsoft.PowerShell.Commands.Diagnostics\CounterSet.cs: parameter in public API

PR Context

Performance using the generic List<string> is much better than using the non-generic StringCollection.

See #13425 (comment) for a benchmark.

PR Checklist

@xtqqczze

This comment has been minimized.

@iSazonov Ilya (iSazonov) added the CL-Performance Indicates that a PR should be marked as a performance improvement in the Change Log label Aug 14, 2020
@xtqqczze

Copy link
Copy Markdown
Contributor Author

Rob Holt (@rjmholt) Could we make changes in LanguagePrimitives.cs?

@ghost ghost added Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept and removed Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept labels Aug 17, 2020
@xtqqczze
xtqqczze marked this pull request as ready for review August 22, 2020 15:52
@xtqqczze

Copy link
Copy Markdown
Contributor Author

Existing formatting was left unchanged, hence Codacy issues.

@xtqqczze

Copy link
Copy Markdown
Contributor Author

Ilya (@iSazonov) can you approve?

@ghost ghost added the Review - Needed The PR is being reviewed label Sep 5, 2020
@ghost

Copy link
Copy Markdown

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Maintainer, please provide feedback and/or mark it as Waiting on Author

@xtqqczze
xtqqczze force-pushed the replace-StringCollection branch from 161da42 to a7a3160 Compare October 24, 2020 17:16
@xtqqczze

Copy link
Copy Markdown
Contributor Author

rebased to remove merge commit

@iSazonov

Copy link
Copy Markdown
Collaborator

xtqqczze Please resolve merge conflicts.

@ghost ghost removed the Review - Needed The PR is being reviewed label Nov 5, 2020
@iSazonov

Copy link
Copy Markdown
Collaborator

xtqqczze I think it is better to split the PR to some small PRs by cmdlet/folder to get more fast progress.

@ghost ghost added the Review - Needed The PR is being reviewed label Nov 13, 2020
@ghost

Copy link
Copy Markdown

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Maintainer, please provide feedback and/or mark it as Waiting on Author

@xtqqczze
xtqqczze marked this pull request as draft November 13, 2020 21:53
@ghost ghost added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Nov 17, 2020
@iSazonov

Ilya (iSazonov) commented Nov 21, 2020 •

Copy link
Copy Markdown
Collaborator

Please look CI fails.

  • Replace StringCollection with List<string>.
  • Replace StringCollection with string[] when length is known.
  • Rename variables for clarity.
  • Refactor GenerateMultiLineRowField as static method.
  • Cache loop invariant integers.

and maybe split the PR by kind of changes since there is a risk of regression.

@ghost ghost removed the Review - Needed The PR is being reviewed label Nov 21, 2020
@ghost ghost added the Stale label Dec 6, 2020
@ghost

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 15 days. It will be closed if no further activity occurs within 10 days of this comment.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-Performance Indicates that a PR should be marked as a performance improvement in the Change Log Stale Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants