(size uint32, b *testing.B)
| 365 | } |
| 366 | |
| 367 | func benchappendString(size uint32, b *testing.B) { |
| 368 | str := string(RandBytes(int(size))) |
| 369 | buf := make([]byte, 0, len(str)+5) |
| 370 | b.SetBytes(int64(len(str) + 5)) |
| 371 | b.ReportAllocs() |
| 372 | b.ResetTimer() |
| 373 | for i := 0; i < b.N; i++ { |
| 374 | AppendString(buf[0:0], str) |
| 375 | } |
| 376 | } |
| 377 | |
| 378 | func BenchmarkAppend16String(b *testing.B) { benchappendString(16, b) } |
| 379 |
no test coverage detected
searching dependent graphs…