mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
vendor files
This commit is contained in:
38
vendor/github.com/gogo/protobuf/io/uint32_test.go
generated
vendored
Normal file
38
vendor/github.com/gogo/protobuf/io/uint32_test.go
generated
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
package io_test
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"io/ioutil"
|
||||
"math/rand"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/gogo/protobuf/test"
|
||||
example "github.com/gogo/protobuf/test/example"
|
||||
|
||||
"github.com/gogo/protobuf/io"
|
||||
)
|
||||
|
||||
func BenchmarkUint32DelimWriterMarshaller(b *testing.B) {
|
||||
w := io.NewUint32DelimitedWriter(ioutil.Discard, binary.BigEndian)
|
||||
r := rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||
msg := example.NewPopulatedA(r, true)
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
if err := w.WriteMsg(msg); err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkUint32DelimWriterFallback(b *testing.B) {
|
||||
w := io.NewUint32DelimitedWriter(ioutil.Discard, binary.BigEndian)
|
||||
r := rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||
msg := test.NewPopulatedNinOptNative(r, true)
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
if err := w.WriteMsg(msg); err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user