Skip to content

Commit

Permalink
Remove protocol v1 (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
FZambia committed Mar 25, 2023
1 parent a69e96c commit 21c7b1b
Show file tree
Hide file tree
Showing 13 changed files with 453 additions and 2,285 deletions.
312 changes: 0 additions & 312 deletions bench_v1_test.go

This file was deleted.

15 changes: 11 additions & 4 deletions bench_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ import (
"testing"
)

func benchPayload() []byte {
size := 256
var p []byte
for i := 0; i < size; i++ {
p = append(p, 'i')
}
return []byte(`{"input":"` + string(p) + `"}`)
}

var preparedPayload = benchPayload()

func marshalProtobufV2() ([]byte, *Reply, error) {
r := &Reply{
Push: &Push{
Expand Down Expand Up @@ -106,7 +117,6 @@ func BenchmarkReplyProtobufUnmarshalV2(b *testing.B) {
}
cmd := &Command{
Id: 1,
Method: Command_CONNECT,
Connect: params,
}
encoder := NewProtobufCommandEncoder()
Expand All @@ -124,7 +134,6 @@ func BenchmarkReplyProtobufUnmarshalParallelV2(b *testing.B) {
}
cmd := &Command{
Id: 1,
Method: Command_CONNECT,
Connect: params,
}
encoder := NewProtobufCommandEncoder()
Expand Down Expand Up @@ -163,7 +172,6 @@ func BenchmarkReplyJSONUnmarshalV2(b *testing.B) {
}
cmd := &Command{
Id: 1,
Method: Command_CONNECT,
Connect: params,
}
encoder := NewJSONCommandEncoder()
Expand All @@ -181,7 +189,6 @@ func BenchmarkReplyJSONUnmarshalParallelV2(b *testing.B) {
}
cmd := &Command{
Id: 1,
Method: Command_CONNECT,
Connect: params,
}
encoder := NewJSONCommandEncoder()
Expand Down
Loading

0 comments on commit 21c7b1b

Please sign in to comment.