-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
perf(config/env): use strings.LastIndexByte instead of strings.LastIndex #3660
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
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.
LGTM
|
Maybe we should include a benchmark test for performance-related changes @1911860538 |
Ok, I will update this PR after today's work. |
benchmark codefunc BenchmarkFormat(b *testing.B) {
for i := 0; i < b.N; i++ {
format("abc.txt")
}
}benchmark output before optimizationbenchmark output after optimization |
|
Thanks for the update, please rebase the code |
9f609d0 to
d489ead
Compare
Done. |
strings.LastIndexByteoffers better performance thanstrings.LastIndex.