-
Notifications
You must be signed in to change notification settings - Fork 39
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
Reduce allocations #29
Conversation
Thanks so much! I'll take a look shortly. |
Great! I suspect the failures above have to do with old Go versions. I updated go.mod and test.yml for Go 1.19 and above (and got rid of the cache), let’s see if that fixes it. (If you’re not ready to update Go version, that’s fine, but at least we’ll have some troubleshooting.) |
Looks good over here: https://github.com/clipperhouse/snowball/actions |
Thanks @clipperhouse. Three quick questions. (I haven't looked at this code in a while, so apologies if these are non-sensical.)
|
Cheers @kljensen
|
Super. I suspect I'll squash merge. Would you add yourself to the list of contributors? |
Done (I assume you mean contributors in the README?) and thanks! I usually squash PRs as well. |
Thanks @clipperhouse merged and released v0.10.0 |
Remove second return parameter
suffixRunes
from many functions, as it’s not used by every caller, and requires an allocation. In many cases, just its length is needed, so useutf8.RuneCountInString
. In cases wheresuffixRunes
is needed, create it locally.Before:
After:
~2x throughput improvement and ~30x allocation reduction.