mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 17:05:38 +00:00
gpu: optimize encodeQuadTo
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>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
// 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},
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user