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

Remove array/object allocs during Alt+Numpad composition, improve performance #9954

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

h3xds1nz
Copy link
Member

@h3xds1nz h3xds1nz commented Oct 14, 2024

Description

Removes unnecessary byte[] , char[] and StringBuilder alocations during post-input processing when the char is inputted via Alt+Numpad combination. This is not somewhat impactful allocation but it will allow for more optimizations in the future.

Time spent is cut by 2/5 which is more impactful in this case.

GetCurrentOEMCPEncoding method chain call

Method Mean [ns] Error [ns] StdDev [ns] Gen0 Code Size [B] Allocated [B]
Original 48.77 ns 0.674 ns 0.630 ns 0.0086 814 B 144 B
PR_EDIT 31.83 ns 0.292 ns 0.273 ns 0.0019 418 B 32 B

Customer Impact

Improved performance, decreased allocations.

Regression

No.

Testing

Local build, text input.

Risk

Low.

Microsoft Reviewers: Open in CodeFlow

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 Included in test pass PR metadata: Label to tag PRs, to facilitate with triage Status:Completed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants