Skip to content
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

[InputLanguageSource.cs] Replace ArrayList with pre-allocated generic List<CultureInfo> #9221

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

h3xds1nz
Copy link

@h3xds1nz h3xds1nz commented Jun 6, 2024

Description

Replaces ArrayList with pre-allocated generic List<CultureInfo> with capacity of 1 item.

Method Mean Error StdDev Gen0 Allocated
InitArrayList_Original 14.244 ns 0.2959 ns 0.3742 ns 0.0052 88 B
InitGenericList_Prealloc_PR 9.069 ns 0.1961 ns 0.1638 ns 0.0038 64 B

Customer Impact

Improved performance, less allocations.

Regression

No.

Testing

Basic build and run.

Risk

None.

Microsoft Reviewers: Open in CodeFlow

@h3xds1nz h3xds1nz requested a review from a team as a code owner June 6, 2024 17:05
@dotnet-policy-service dotnet-policy-service bot added PR metadata: Label to tag PRs, to facilitate with triage Community Contribution A label for all community Contributions labels Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community Contribution A label for all community Contributions PR metadata: Label to tag PRs, to facilitate with triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant