Skip to content

Commit

Permalink
Merge pull request #5356 from jsternberg/vtproto
Browse files Browse the repository at this point in the history
protobuf: add vtproto as a supplemental marshaler
  • Loading branch information
tonistiigi authored Oct 7, 2024
2 parents c1dacbc + 41a0a0c commit 605c469
Show file tree
Hide file tree
Showing 72 changed files with 54,244 additions and 152 deletions.
14 changes: 7 additions & 7 deletions api/services/control/control_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

digest "github.com/opencontainers/go-digest"
"github.com/stretchr/testify/require"
"google.golang.org/protobuf/proto"
proto "google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/timestamppb"
)

Expand All @@ -17,7 +17,7 @@ func BenchmarkMarshalVertex(b *testing.B) {
v := sampleVertex()
for i := 0; i < b.N; i++ {
var err error
Buf, err = proto.Marshal(v)
Buf, err = v.MarshalVT()
require.NoError(b, err)
}
}
Expand All @@ -26,7 +26,7 @@ func BenchmarkMarshalVertexStatus(b *testing.B) {
v := sampleVertexStatus()
for i := 0; i < b.N; i++ {
var err error
Buf, err = proto.Marshal(v)
Buf, err = v.MarshalVT()
require.NoError(b, err)
}
}
Expand All @@ -35,7 +35,7 @@ func BenchmarkMarshalVertexLog(b *testing.B) {
v := sampleVertexLog()
for i := 0; i < b.N; i++ {
var err error
Buf, err = proto.Marshal(v)
Buf, err = v.MarshalVT()
require.NoError(b, err)
}
}
Expand All @@ -48,7 +48,7 @@ func BenchmarkUnmarshalVertex(b *testing.B) {
require.NoError(b, err)

for i := 0; i < b.N; i++ {
err := proto.Unmarshal(buf, &VertexOutput)
err := VertexOutput.UnmarshalVT(buf)
require.NoError(b, err)
}
}
Expand All @@ -61,7 +61,7 @@ func BenchmarkUnmarshalVertexStatus(b *testing.B) {
require.NoError(b, err)

for i := 0; i < b.N; i++ {
err := proto.Unmarshal(buf, &VertexStatusOutput)
err := VertexStatusOutput.UnmarshalVT(buf)
require.NoError(b, err)
}
}
Expand All @@ -74,7 +74,7 @@ func BenchmarkUnmarshalVertexLog(b *testing.B) {
require.NoError(b, err)

for i := 0; i < b.N; i++ {
err := proto.Unmarshal(buf, &VertexLogOutput)
err := VertexLogOutput.UnmarshalVT(buf)
require.NoError(b, err)
}
}
Expand Down
Loading

0 comments on commit 605c469

Please sign in to comment.