Skip to content

Commit

Permalink
Use different values in bench
Browse files Browse the repository at this point in the history
  • Loading branch information
nak3 committed Aug 9, 2023
1 parent d5e5602 commit 400eb43
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions v2/bench_test.go
Expand Up @@ -19,8 +19,8 @@ func BenchmarkCreatePatch(b *testing.B) {
},
{
"large array",
largeArray(1000),
largeArray(1000),
largeArray(1000, "a"),
largeArray(1000, "b"),
},
{
"simple",
Expand All @@ -40,7 +40,7 @@ func BenchmarkCreatePatch(b *testing.B) {
}
}

func largeArray(size int) string {
func largeArray(size int, val string) string {
type nested struct {
A, B string
}
Expand All @@ -49,7 +49,7 @@ func largeArray(size int) string {
}
a := example{}
for i := 0; i < size; i++ {
a.Objects = append(a.Objects, nested{A: "a", B: "b"})
a.Objects = append(a.Objects, nested{A: "a", B: val})
}
res, _ := json.Marshal(a)
return string(res)
Expand Down

0 comments on commit 400eb43

Please sign in to comment.