MCPcopy Create free account
hub / github.com/egonelbre/exp / BenchmarkAddMul

Function BenchmarkAddMul

bench/vector_fusing/vector_test.go:17–24  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

15}
16
17func BenchmarkAddMul(b *testing.B) {
18 x, y := Vec3{1, 2, 3}, Vec3{5, 6, 7}
19 for i := 0; i < b.N; i++ {
20 x = x.Add(y.Mul(0.15))
21 }
22 runtime.KeepAlive(x)
23 runtime.KeepAlive(y)
24}
25
26func BenchmarkAddMulFused(b *testing.B) {
27 x, y := Vec3{1, 2, 3}, Vec3{5, 6, 7}

Callers

nothing calls this directly

Calls 2

AddMethod · 0.95
MulMethod · 0.95

Tested by

no test coverage detected