refactor: use b.Loop() in benchmark tests for better performance (#25461)
Signed-off-by: wyrapeseed <wyrapeseed@outlook.com> Co-authored-by: Alex | Cosmos Labs <alex@cosmoslabs.io>
This commit is contained in:
co-authored by
Alex | Cosmos Labs
parent
72c71c3fa8
commit
abc305483d
@@ -52,7 +52,7 @@ func (s *StringSuite) TestUnsafeBytesToStr() {
|
||||
}
|
||||
|
||||
func BenchmarkUnsafeStrToBytes(b *testing.B) {
|
||||
for i := 0; i < b.N; i++ {
|
||||
for i := 0; b.Loop(); i++ {
|
||||
UnsafeStrToBytes(strconv.Itoa(i))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user