add benchmark for all marshal functions

This commit is contained in:
Joel Wetzell
2026-05-30 10:54:20 -05:00
parent 968ad64521
commit bd47dddb58
8 changed files with 88 additions and 0 deletions
+11
View File
@@ -30,3 +30,14 @@ func TestGoodArtCommandUnmarshal(t *testing.T) {
})
}
}
func BenchmarkArtCommandMarshalBinary(b *testing.B) {
data := artnet.ArtCommand{}
for b.Loop() {
_, err := data.MarshalBinary()
if err != nil {
b.Fatalf("failed to encode ArtCommand: %s", err)
}
}
}
+11
View File
@@ -30,3 +30,14 @@ func TestGoodArtDataRequestUnmarshal(t *testing.T) {
})
}
}
func BenchmarkArtDataRequestMarshalBinary(b *testing.B) {
data := artnet.ArtDataRequest{}
for b.Loop() {
_, err := data.MarshalBinary()
if err != nil {
b.Fatalf("failed to encode ArtDataRequest: %s", err)
}
}
}
+11
View File
@@ -30,3 +30,14 @@ func TestGoodArtDiagDataUnmarshal(t *testing.T) {
})
}
}
func BenchmarkArtDiagDataMarshalBinary(b *testing.B) {
data := artnet.ArtDiagData{}
for b.Loop() {
_, err := data.MarshalBinary()
if err != nil {
b.Fatalf("failed to encode ArtDiagData: %s", err)
}
}
}
+11
View File
@@ -30,3 +30,14 @@ func TestGoodArtIpProgReplyUnmarshal(t *testing.T) {
})
}
}
func BenchmarkArtIpProgReplyMarshalBinary(b *testing.B) {
data := artnet.ArtIpProgReply{}
for b.Loop() {
_, err := data.MarshalBinary()
if err != nil {
b.Fatalf("failed to encode ArtIpProgReply: %s", err)
}
}
}
+11
View File
@@ -30,3 +30,14 @@ func TestGoodArtNzsUnmarshal(t *testing.T) {
})
}
}
func BenchmarkArtNzsMarshalBinary(b *testing.B) {
data := artnet.ArtNzs{}
for b.Loop() {
_, err := data.MarshalBinary()
if err != nil {
b.Fatalf("failed to encode ArtNzs: %s", err)
}
}
}
+11
View File
@@ -30,3 +30,14 @@ func TestGoodArtPollReplyUnmarshal(t *testing.T) {
})
}
}
func BenchmarkArtPollReplyMarshalBinary(b *testing.B) {
data := artnet.ArtPollReply{}
for b.Loop() {
_, err := data.MarshalBinary()
if err != nil {
b.Fatalf("failed to encode ArtPollReply: %s", err)
}
}
}
+11
View File
@@ -30,3 +30,14 @@ func TestGoodArtSyncUnmarshal(t *testing.T) {
})
}
}
func BenchmarkArtSyncMarshalBinary(b *testing.B) {
data := artnet.ArtSync{}
for b.Loop() {
_, err := data.MarshalBinary()
if err != nil {
b.Fatalf("failed to encode ArtSync: %s", err)
}
}
}
+11
View File
@@ -30,3 +30,14 @@ func TestGoodArtTriggerUnmarshal(t *testing.T) {
})
}
}
func BenchmarkArtTriggerMarshalBinary(b *testing.B) {
data := artnet.ArtTrigger{}
for b.Loop() {
_, err := data.MarshalBinary()
if err != nil {
b.Fatalf("failed to encode ArtTrigger: %s", err)
}
}
}