mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-05-15 05:54:17 +00:00
add basic benchmark for most processors
This commit is contained in:
@@ -112,3 +112,23 @@ func TestBadOSCMessageEncode(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkOSCMessageEncode(b *testing.B) {
|
||||
processorInstance := processor.OSCMessageEncode{}
|
||||
payload := &osc.OSCMessage{
|
||||
Address: "/test",
|
||||
Args: []osc.OSCArg{
|
||||
{
|
||||
Type: "i",
|
||||
Value: int32(42),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for b.Loop() {
|
||||
_, err := processorInstance.Process(b.Context(), common.WrappedPayload{Payload: payload})
|
||||
if err != nil {
|
||||
b.Fatalf("osc.message.encode processing failed: %s", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user