forked from joejulian/gio
8bc6737dea
name old time/op new time/op delta EncodeQuadTo-32 35.4ns ± 1% 11.9ns ± 3% -66.34% (p=0.008 n=5+5) Signed-off-by: Egon Elbre <egonelbre@gmail.com>
22 lines
345 B
Go
22 lines
345 B
Go
// SPDX-License-Identifier: Unlicense OR MIT
|
|
|
|
package gpu
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"gioui.org/internal/f32"
|
|
)
|
|
|
|
func BenchmarkEncodeQuadTo(b *testing.B) {
|
|
var data [vertStride * 4]byte
|
|
for i := 0; i < b.N; i++ {
|
|
v := float32(i)
|
|
encodeQuadTo(data[:], 123,
|
|
f32.Point{X: v, Y: v},
|
|
f32.Point{X: v, Y: v},
|
|
f32.Point{X: v, Y: v},
|
|
)
|
|
}
|
|
}
|