-
-
Notifications
You must be signed in to change notification settings - Fork 596
Reduce memory usage for rune width cache. #1756
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
Conversation
@microsoft-github-policy-service agree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I was the last to touch this an it looks good to me. Pulled it down and tested it, all good. Slightly faster. Only thing I'd be tempted to change would be using Array.Fill instead of the loop to grab some perf since that's the goal here, but we'd need a polyfill or a conditional for a fall back to the loop for netstandard 2.0
Done |
will this be merged? |
Merged! Thank you for your contribution. Much appreciated! 👍 |
thanks!<3 |
Changes
The rune width cache array consumes half a megabyte because it uses a Nullable to store values. This PR slashes the memory requirements to an eighth of what it was before with no loss of functionality.
Please upvote 👍 this pull request if you are interested in it.