add basic benchmark for most processors

This commit is contained in:
Joel Wetzell
2026-05-14 19:44:19 -05:00
parent fa4997ba78
commit 9eb05c8360
43 changed files with 1085 additions and 12 deletions
@@ -101,3 +101,26 @@ func TestBadArtnetPacketEncode(t *testing.T) {
})
}
}
func BenchmarkArtnetPacketEncode(b *testing.B) {
processorInstance := processor.ArtNetPacketEncode{}
payload := &artnet.ArtDmx{
ID: []byte{'A', 'r', 't', '-', 'N', 'e', 't', 0x00},
OpCode: artnet.OpDmx,
ProtVerHi: 0,
ProtVerLo: 14,
Sequence: 237,
Physical: 0,
SubUni: 1,
Net: 0,
Length: 512,
Data: make([]uint8, 512),
}
for b.Loop() {
_, err := processorInstance.Process(b.Context(), common.WrappedPayload{Payload: payload})
if err != nil {
b.Fatalf("artnet.packet.encode processing failed: %s", err)
}
}
}