Skip to content

perf(all): use strings.Cut and strings.LastIndexByte for better performance#3661

Open
1911860538 wants to merge 5 commits into
go-kratos:mainfrom
1911860538:strings/split
Open

perf(all): use strings.Cut and strings.LastIndexByte for better performance#3661
1911860538 wants to merge 5 commits into
go-kratos:mainfrom
1911860538:strings/split

Conversation

@1911860538
Copy link
Copy Markdown
Contributor

Replaced strings.Split and strings.SplitN with strings.Cut and strings.LastIndexByte, to reduce memory allocations and improve performance. strings.Cut also simplifies the code, making it more readable and maintainable.

@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label May 13, 2025
@1911860538 1911860538 changed the title perf(all): Use strings.Cut and strings.LastIndexByte for better performance perf(all): use strings.Cut and strings.LastIndexByte for better performance May 13, 2025
@kratos-ci-bot
Copy link
Copy Markdown
Collaborator

⚠️ Non-English comments were found in the following locations:


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants