Skip to content

Commit 927a3f1

Browse files
committed
feat(builder): add SetBytes to bench
1 parent ca2d530 commit 927a3f1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

utils/binary/builder_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ func TestBuilderTEA(t *testing.T) {
7474
func BenchmarkNewBuilder128(b *testing.B) {
7575
test := make([]byte, 128)
7676
_, _ = rand.Read(test)
77+
b.SetBytes(int64(len(test)))
7778
b.StartTimer()
7879
b.RunParallel(func(pb *testing.PB) {
7980
for pb.Next() {
@@ -85,6 +86,7 @@ func BenchmarkNewBuilder128(b *testing.B) {
8586
func BenchmarkNewBuilder128_3(b *testing.B) {
8687
test := make([]byte, 128)
8788
_, _ = rand.Read(test)
89+
b.SetBytes(int64(len(test)))
8890
b.StartTimer()
8991
b.RunParallel(func(pb *testing.PB) {
9092
for pb.Next() {
@@ -100,6 +102,7 @@ func BenchmarkNewBuilder128_3(b *testing.B) {
100102
func BenchmarkNewBuilder128_5(b *testing.B) {
101103
test := make([]byte, 128)
102104
_, _ = rand.Read(test)
105+
b.SetBytes(int64(len(test)))
103106
b.StartTimer()
104107
b.RunParallel(func(pb *testing.PB) {
105108
for pb.Next() {

0 commit comments

Comments
 (0)