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

⚡ Two small performance improvements #74

Merged
merged 2 commits into from
Apr 4, 2021
Merged

Conversation

AndreasSko
Copy link
Owner

⚡ Grow strings.Builder at beginning

This should reduce the number of growSlice operations resulting in some minor speedups. The number was determined by looking at the average size of keys.

⚡ More efficient Regex umbr.Equals

Instead of doing replace, a FindStringSubmatch is actually all that's needed. It is just a minor change, but still reduces the runtime by a few tens of milliseconds.

See #47 for a similar improvement.

This should reduce the number of `growSlice`
operations resulting in some minor speedups.
The number was determined by looking at the
average size of keys.
Instead of doing replace, a
`FindStringSubmatch` is actually all that's
needed. It is just a minor change, but still
reduces the runtime by a few tens of
milliseconds.

See #47
for a similar improvement.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.009%) to 86.327% when pulling a5ae6e8 on small_perf_improvements into 66622c8 on master.

@AndreasSko AndreasSko merged commit da48705 into master Apr 4, 2021
@AndreasSko AndreasSko deleted the small_perf_improvements branch April 4, 2021 14:12
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.

2 participants