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

PERF: Optimize StringExtensions.cs #22

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

Conversation

perf-cat
Copy link

Hi, I've tried to make some performance optimizations to this repo. Following are the benchmark results before and after the changes:

Benchmarks before changes:

Method Mean Error StdDev Gen 0 Allocated
OnlyNumbers 161.3 ns 2.40 ns 2.13 ns 0.0072 136 B
NetDevPackOnlyNumber 149.5 ns 3.09 ns 2.89 ns 0.0103 192 B

Benchmarks after changes:

Method Mean Error StdDev Gen 0 Allocated
OnlyNumbers 165.4 ns 3.31 ns 4.54 ns 0.0072 136 B
NetDevPackOnlyNumber 126.9 ns 2.68 ns 4.61 ns 0.0076 144 B

As you can see the durations and allocations have gone down. I've also made sure that all the unit tests pass following these changes as well. Could you please confirm whether or not you think my changes are valid?

Thank you!

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.

None yet

2 participants