Added benchmark for MakeTrianglesData

This commit is contained in:
Ben Cragg 2019-04-24 11:17:48 +01:00
parent 159df28dcc
commit 9e6e6197dd
1 changed files with 24 additions and 0 deletions

View File

@ -6,6 +6,30 @@ import (
"github.com/faiface/pixel"
)
func BenchmarkMakeTrianglesData(b *testing.B) {
tests := []struct {
name string
len int
}{
{
name: "Small slice",
len: 10,
},
{
name: "Large slice",
len: 10000,
},
}
for _, tt := range tests {
b.Run(tt.name, func(b *testing.B) {
for i := 0; i < b.N; i++ {
_ = pixel.MakeTrianglesData(tt.len)
}
})
}
}
func BenchmarkTrianglesData_Len(b *testing.B) {
tests := []struct {
name string