We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
While doing some benchmarking, I noticed that strings.IndexByte was slower than a simple index-based for loop. This was originally reported here: https://groups.google.com/forum/#!topic/golang-nuts/Vjy_UUcugPE
Keith observed that the benchmark ran faster when the string length was increased to 16 characters.
For a < 16 character string, the results change dramatically:
BenchmarkGetHostIndexByte-8 100000000 23.3 ns/op BenchmarkGetHostIndexLoop-8 200000000 9.92 ns/op
For a 16 character string, the benchmarks are:
BenchmarkGetHostIndexByte-8 200000000 5.91 ns/op BenchmarkGetHostIndexLoop-8 200000000 9.17 ns/op
Keith mentioned that the REP instruction was most likely to blame.
REP
The text was updated successfully, but these errors were encountered:
Keith sent https://go-review.googlesource.com/#/c/18703/
Sorry, something went wrong.
CL https://golang.org/cl/18703 mentions this issue.
687abca
No branches or pull requests
While doing some benchmarking, I noticed that strings.IndexByte was slower than a simple index-based for loop. This was originally reported here:
https://groups.google.com/forum/#!topic/golang-nuts/Vjy_UUcugPE
Keith observed that the benchmark ran faster when the string length was increased to 16 characters.
For a < 16 character string, the results change dramatically:
For a 16 character string, the benchmarks are:
Keith mentioned that the
REP
instruction was most likely to blame.The text was updated successfully, but these errors were encountered: