bencher

package module
v0.0.0-...-6138ff9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

README

bencher

benchmarks for proto with redis

Usage

Run benchmarks
make test

Benchmark Results

Takes 0.03ms for basic SET and GET in Redis without load in local

Local results when service and redis are in same host (local imac)
Benchmark_ProtoUnmarshal_MerchantV1-8    	 3567019	       371.9 ns/op	         3.001 B/serial	       3 B/op	       0 allocs/op
Benchmark_ProtoMarshal_MerchantV1-8      	 4795518	       329.9 ns/op	         3.002 B/serial	      48 B/op	       1 allocs/op
Benchmark_ProtoMarshal_MerchantV38-8     	 1221247	       981.7 ns/op	        49.52 B/serial	      57 B/op	       1 allocs/op
Benchmark_ProtoUnmarshal_MerchantV38-8   	 2493229	       512.5 ns/op	        49.50 B/serial	      80 B/op	       1 allocs/op

Benchmark_RedisSet_MerchantV1-8          	   37177	     31211 ns/op
Benchmark_RedisSet_MerchantV38-8         	   40179	     31315 ns/op

Benchmark_RedisGet_MerchantV1-8          	   39410	     30966 ns/op
Benchmark_RedisGet_MerchantV38-8         	   37562	     30866 ns/op
EC2 (mumbai) -> Redis Labs (Mumbai)

Takes 0.3ms for basic SET and GET in Redis without load in Mumbai.

Benchmark_ProtoUnmarshal_MerchantV1-2    	 3226676	       407.9 ns/op	         3.000 B/serial	       3 B/op	       0 allocs/op
Benchmark_ProtoMarshal_MerchantV1-2      	 3087302	       431.0 ns/op	         2.998 B/serial	      48 B/op	       1 allocs/op

Benchmark_ProtoMarshal_MerchantV38-2     	  982110	      1223 ns/op	        49.51 B/serial	      57 B/op	       1 allocs/op
Benchmark_ProtoUnmarshal_MerchantV38-2   	 1792717	       719.2 ns/op	        49.51 B/serial	      80 B/op	       1 allocs/op

Benchmark_RedisSet_MerchantV1-2          	    3054	    388322 ns/op
Benchmark_RedisSet_MerchantV38-2         	    3162	    365419 ns/op

Benchmark_RedisGet_MerchantV1-2          	    2562	    397538 ns/op
Benchmark_RedisGet_MerchantV38-2         	    3160	    370145 ns/op

Contributing

  • add .proto file with your message. Eg: vi merchant_v1.proto
  • make generate to generate the .pg.go Eg: merchant_v1.pb.go
  • add your test functions in bencher_v1_test.go
  • make test to run the benchmark tests (local)
  • export REDIS_HOST=https://someurl.com make test

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_merchant_v1_proto protoreflect.FileDescriptor
View Source
var File_merchant_v38fields_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type MerchantV1

type MerchantV1 struct {
	RefundDisabled     bool `protobuf:"varint,1,opt,name=refund_disabled,json=refundDisabled,proto3" json:"refund_disabled,omitempty"`
	AutoRefundDisabled bool `protobuf:"varint,2,opt,name=auto_refund_disabled,json=autoRefundDisabled,proto3" json:"auto_refund_disabled,omitempty"`
	BlockSettlement    bool `protobuf:"varint,3,opt,name=block_settlement,json=blockSettlement,proto3" json:"block_settlement,omitempty"`
	// contains filtered or unexported fields
}

func (*MerchantV1) Descriptor deprecated

func (*MerchantV1) Descriptor() ([]byte, []int)

Deprecated: Use MerchantV1.ProtoReflect.Descriptor instead.

func (*MerchantV1) GetAutoRefundDisabled

func (x *MerchantV1) GetAutoRefundDisabled() bool

func (*MerchantV1) GetBlockSettlement

func (x *MerchantV1) GetBlockSettlement() bool

func (*MerchantV1) GetRefundDisabled

func (x *MerchantV1) GetRefundDisabled() bool

func (*MerchantV1) ProtoMessage

func (*MerchantV1) ProtoMessage()

func (*MerchantV1) ProtoReflect

func (x *MerchantV1) ProtoReflect() protoreflect.Message

func (*MerchantV1) Reset

func (x *MerchantV1) Reset()

func (*MerchantV1) String

func (x *MerchantV1) String() string

type MerchantV38Fields

type MerchantV38Fields struct {
	RefundDisabled     bool `protobuf:"varint,1,opt,name=refund_disabled,json=refundDisabled,proto3" json:"refund_disabled,omitempty"`
	AutoRefundDisabled bool `protobuf:"varint,2,opt,name=auto_refund_disabled,json=autoRefundDisabled,proto3" json:"auto_refund_disabled,omitempty"`
	BlockSettlement    bool `protobuf:"varint,3,opt,name=block_settlement,json=blockSettlement,proto3" json:"block_settlement,omitempty"`
	BlockSettlement4   bool `protobuf:"varint,4,opt,name=block_settlement4,json=blockSettlement4,proto3" json:"block_settlement4,omitempty"`
	BlockSettlement5   bool `protobuf:"varint,5,opt,name=block_settlement5,json=blockSettlement5,proto3" json:"block_settlement5,omitempty"`
	BlockSettlement6   bool `protobuf:"varint,6,opt,name=block_settlement6,json=blockSettlement6,proto3" json:"block_settlement6,omitempty"`
	BlockSettlement7   bool `protobuf:"varint,7,opt,name=block_settlement7,json=blockSettlement7,proto3" json:"block_settlement7,omitempty"`
	BlockSettlement8   bool `protobuf:"varint,8,opt,name=block_settlement8,json=blockSettlement8,proto3" json:"block_settlement8,omitempty"`
	BlockSettlement9   bool `protobuf:"varint,9,opt,name=block_settlement9,json=blockSettlement9,proto3" json:"block_settlement9,omitempty"`
	BlockSettlement10  bool `protobuf:"varint,10,opt,name=block_settlement10,json=blockSettlement10,proto3" json:"block_settlement10,omitempty"`
	BlockSettlement11  bool `protobuf:"varint,11,opt,name=block_settlement11,json=blockSettlement11,proto3" json:"block_settlement11,omitempty"`
	BlockSettlement12  bool `protobuf:"varint,12,opt,name=block_settlement12,json=blockSettlement12,proto3" json:"block_settlement12,omitempty"`
	BlockSettlement13  bool `protobuf:"varint,13,opt,name=block_settlement13,json=blockSettlement13,proto3" json:"block_settlement13,omitempty"`
	BlockSettlement14  bool `protobuf:"varint,14,opt,name=block_settlement14,json=blockSettlement14,proto3" json:"block_settlement14,omitempty"`
	BlockSettlement15  bool `protobuf:"varint,15,opt,name=block_settlement15,json=blockSettlement15,proto3" json:"block_settlement15,omitempty"`
	BlockSettlement16  bool `protobuf:"varint,16,opt,name=block_settlement16,json=blockSettlement16,proto3" json:"block_settlement16,omitempty"`
	BlockSettlement17  bool `protobuf:"varint,17,opt,name=block_settlement17,json=blockSettlement17,proto3" json:"block_settlement17,omitempty"`
	BlockSettlement18  bool `protobuf:"varint,18,opt,name=block_settlement18,json=blockSettlement18,proto3" json:"block_settlement18,omitempty"`
	BlockSettlement19  bool `protobuf:"varint,19,opt,name=block_settlement19,json=blockSettlement19,proto3" json:"block_settlement19,omitempty"`
	BlockSettlement20  bool `protobuf:"varint,20,opt,name=block_settlement20,json=blockSettlement20,proto3" json:"block_settlement20,omitempty"`
	BlockSettlement21  bool `protobuf:"varint,21,opt,name=block_settlement21,json=blockSettlement21,proto3" json:"block_settlement21,omitempty"`
	BlockSettlement22  bool `protobuf:"varint,22,opt,name=block_settlement22,json=blockSettlement22,proto3" json:"block_settlement22,omitempty"`
	BlockSettlement23  bool `protobuf:"varint,23,opt,name=block_settlement23,json=blockSettlement23,proto3" json:"block_settlement23,omitempty"`
	BlockSettlement24  bool `protobuf:"varint,24,opt,name=block_settlement24,json=blockSettlement24,proto3" json:"block_settlement24,omitempty"`
	BlockSettlement25  bool `protobuf:"varint,25,opt,name=block_settlement25,json=blockSettlement25,proto3" json:"block_settlement25,omitempty"`
	BlockSettlement26  bool `protobuf:"varint,26,opt,name=block_settlement26,json=blockSettlement26,proto3" json:"block_settlement26,omitempty"`
	BlockSettlement27  bool `protobuf:"varint,27,opt,name=block_settlement27,json=blockSettlement27,proto3" json:"block_settlement27,omitempty"`
	BlockSettlement28  bool `protobuf:"varint,28,opt,name=block_settlement28,json=blockSettlement28,proto3" json:"block_settlement28,omitempty"`
	BlockSettlement29  bool `protobuf:"varint,29,opt,name=block_settlement29,json=blockSettlement29,proto3" json:"block_settlement29,omitempty"`
	BlockSettlement30  bool `protobuf:"varint,30,opt,name=block_settlement30,json=blockSettlement30,proto3" json:"block_settlement30,omitempty"`
	BlockSettlement31  bool `protobuf:"varint,31,opt,name=block_settlement31,json=blockSettlement31,proto3" json:"block_settlement31,omitempty"`
	BlockSettlement32  bool `protobuf:"varint,32,opt,name=block_settlement32,json=blockSettlement32,proto3" json:"block_settlement32,omitempty"`
	BlockSettlement33  bool `protobuf:"varint,33,opt,name=block_settlement33,json=blockSettlement33,proto3" json:"block_settlement33,omitempty"`
	BlockSettlement34  bool `protobuf:"varint,34,opt,name=block_settlement34,json=blockSettlement34,proto3" json:"block_settlement34,omitempty"`
	BlockSettlement35  bool `protobuf:"varint,35,opt,name=block_settlement35,json=blockSettlement35,proto3" json:"block_settlement35,omitempty"`
	BlockSettlement36  bool `protobuf:"varint,36,opt,name=block_settlement36,json=blockSettlement36,proto3" json:"block_settlement36,omitempty"`
	BlockSettlement37  bool `protobuf:"varint,37,opt,name=block_settlement37,json=blockSettlement37,proto3" json:"block_settlement37,omitempty"`
	BlockSettlement38  bool `protobuf:"varint,38,opt,name=block_settlement38,json=blockSettlement38,proto3" json:"block_settlement38,omitempty"`
	// contains filtered or unexported fields
}

func (*MerchantV38Fields) Descriptor deprecated

func (*MerchantV38Fields) Descriptor() ([]byte, []int)

Deprecated: Use MerchantV38Fields.ProtoReflect.Descriptor instead.

func (*MerchantV38Fields) GetAutoRefundDisabled

func (x *MerchantV38Fields) GetAutoRefundDisabled() bool

func (*MerchantV38Fields) GetBlockSettlement

func (x *MerchantV38Fields) GetBlockSettlement() bool

func (*MerchantV38Fields) GetBlockSettlement10

func (x *MerchantV38Fields) GetBlockSettlement10() bool

func (*MerchantV38Fields) GetBlockSettlement11

func (x *MerchantV38Fields) GetBlockSettlement11() bool

func (*MerchantV38Fields) GetBlockSettlement12

func (x *MerchantV38Fields) GetBlockSettlement12() bool

func (*MerchantV38Fields) GetBlockSettlement13

func (x *MerchantV38Fields) GetBlockSettlement13() bool

func (*MerchantV38Fields) GetBlockSettlement14

func (x *MerchantV38Fields) GetBlockSettlement14() bool

func (*MerchantV38Fields) GetBlockSettlement15

func (x *MerchantV38Fields) GetBlockSettlement15() bool

func (*MerchantV38Fields) GetBlockSettlement16

func (x *MerchantV38Fields) GetBlockSettlement16() bool

func (*MerchantV38Fields) GetBlockSettlement17

func (x *MerchantV38Fields) GetBlockSettlement17() bool

func (*MerchantV38Fields) GetBlockSettlement18

func (x *MerchantV38Fields) GetBlockSettlement18() bool

func (*MerchantV38Fields) GetBlockSettlement19

func (x *MerchantV38Fields) GetBlockSettlement19() bool

func (*MerchantV38Fields) GetBlockSettlement20

func (x *MerchantV38Fields) GetBlockSettlement20() bool

func (*MerchantV38Fields) GetBlockSettlement21

func (x *MerchantV38Fields) GetBlockSettlement21() bool

func (*MerchantV38Fields) GetBlockSettlement22

func (x *MerchantV38Fields) GetBlockSettlement22() bool

func (*MerchantV38Fields) GetBlockSettlement23

func (x *MerchantV38Fields) GetBlockSettlement23() bool

func (*MerchantV38Fields) GetBlockSettlement24

func (x *MerchantV38Fields) GetBlockSettlement24() bool

func (*MerchantV38Fields) GetBlockSettlement25

func (x *MerchantV38Fields) GetBlockSettlement25() bool

func (*MerchantV38Fields) GetBlockSettlement26

func (x *MerchantV38Fields) GetBlockSettlement26() bool

func (*MerchantV38Fields) GetBlockSettlement27

func (x *MerchantV38Fields) GetBlockSettlement27() bool

func (*MerchantV38Fields) GetBlockSettlement28

func (x *MerchantV38Fields) GetBlockSettlement28() bool

func (*MerchantV38Fields) GetBlockSettlement29

func (x *MerchantV38Fields) GetBlockSettlement29() bool

func (*MerchantV38Fields) GetBlockSettlement30

func (x *MerchantV38Fields) GetBlockSettlement30() bool

func (*MerchantV38Fields) GetBlockSettlement31

func (x *MerchantV38Fields) GetBlockSettlement31() bool

func (*MerchantV38Fields) GetBlockSettlement32

func (x *MerchantV38Fields) GetBlockSettlement32() bool

func (*MerchantV38Fields) GetBlockSettlement33

func (x *MerchantV38Fields) GetBlockSettlement33() bool

func (*MerchantV38Fields) GetBlockSettlement34

func (x *MerchantV38Fields) GetBlockSettlement34() bool

func (*MerchantV38Fields) GetBlockSettlement35

func (x *MerchantV38Fields) GetBlockSettlement35() bool

func (*MerchantV38Fields) GetBlockSettlement36

func (x *MerchantV38Fields) GetBlockSettlement36() bool

func (*MerchantV38Fields) GetBlockSettlement37

func (x *MerchantV38Fields) GetBlockSettlement37() bool

func (*MerchantV38Fields) GetBlockSettlement38

func (x *MerchantV38Fields) GetBlockSettlement38() bool

func (*MerchantV38Fields) GetBlockSettlement4

func (x *MerchantV38Fields) GetBlockSettlement4() bool

func (*MerchantV38Fields) GetBlockSettlement5

func (x *MerchantV38Fields) GetBlockSettlement5() bool

func (*MerchantV38Fields) GetBlockSettlement6

func (x *MerchantV38Fields) GetBlockSettlement6() bool

func (*MerchantV38Fields) GetBlockSettlement7

func (x *MerchantV38Fields) GetBlockSettlement7() bool

func (*MerchantV38Fields) GetBlockSettlement8

func (x *MerchantV38Fields) GetBlockSettlement8() bool

func (*MerchantV38Fields) GetBlockSettlement9

func (x *MerchantV38Fields) GetBlockSettlement9() bool

func (*MerchantV38Fields) GetRefundDisabled

func (x *MerchantV38Fields) GetRefundDisabled() bool

func (*MerchantV38Fields) ProtoMessage

func (*MerchantV38Fields) ProtoMessage()

func (*MerchantV38Fields) ProtoReflect

func (x *MerchantV38Fields) ProtoReflect() protoreflect.Message

func (*MerchantV38Fields) Reset

func (x *MerchantV38Fields) Reset()

func (*MerchantV38Fields) String

func (x *MerchantV38Fields) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL