Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: decrease gc #32

Merged
merged 1 commit into from
Oct 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions example/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20211007054845-07e6f4405545 h1:7hwhZ5YPaRexPOyHVTFcYqIsBcB8s/uFdEyKts5yXS4=
dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20211007054845-07e6f4405545/go.mod h1:84/HH7kK42HDa3DXrtj0Eyy2bVBstV3Z3sF0s4NcXZY=
dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20211011045321-e213f97fda57 h1:8s534SRhqQ7Kl6SNJKOoS2PtmEWuGz6zpEj9hixvs/A=
dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20211011045321-e213f97fda57/go.mod h1:84/HH7kK42HDa3DXrtj0Eyy2bVBstV3Z3sF0s4NcXZY=
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
Expand Down Expand Up @@ -182,8 +180,8 @@ github.com/dubbogo/go-zookeeper v1.0.3/go.mod h1:fn6n2CAEer3novYgk9ULLwAjuV8/g4D
github.com/dubbogo/gost v1.9.0/go.mod h1:pPTjVyoJan3aPxBPNUX0ADkXjPibLo+/Ib0/fADXSG8=
github.com/dubbogo/gost v1.11.12/go.mod h1:vIcP9rqz2KsXHPjsAwIUtfJIJjppQLQDcYaZTy/61jI=
github.com/dubbogo/gost v1.11.17/go.mod h1:vIcP9rqz2KsXHPjsAwIUtfJIJjppQLQDcYaZTy/61jI=
github.com/dubbogo/gost v1.11.18-0.20211011142005-8a95129ef6e2 h1:UU3dQZo/NE6VUf6ib5lyAjDfxuI6qX+aq8OZZx649JE=
github.com/dubbogo/gost v1.11.18-0.20211011142005-8a95129ef6e2/go.mod h1:vIcP9rqz2KsXHPjsAwIUtfJIJjppQLQDcYaZTy/61jI=
github.com/dubbogo/gost v1.11.18 h1:e9WRvDQut6cePYcQEOUC15vGSfftO7q9G2+Vw2s4CHE=
github.com/dubbogo/gost v1.11.18/go.mod h1:vIcP9rqz2KsXHPjsAwIUtfJIJjppQLQDcYaZTy/61jI=
github.com/dubbogo/jsonparser v1.0.1/go.mod h1:tYAtpctvSP/tWw4MeelsowSPgXQRVHHWbqL6ynps8jU=
github.com/dubbogo/net v0.0.4 h1:Rn9aMPZwOiRE22YhtxmDEE3H0Q3cfVRNhuEjNMelJ/8=
github.com/dubbogo/net v0.0.4/go.mod h1:1CGOnM7X3he+qgGNqjeADuE5vKZQx/eMSeUkpU3ujIc=
Expand Down
2 changes: 1 addition & 1 deletion internal/codec/codec_impl/codec_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func (h *GenericCodec) UnmarshalRequest(data []byte) ([]interface{}, error) {
if err != nil {
return nil, err
}
result := make([]interface{}, 0)
result := make([]interface{}, 0, len(wrapperRequest.Args))

for _, value := range wrapperRequest.Args {
decoder := hessian.NewDecoder(value)
Expand Down
4 changes: 2 additions & 2 deletions internal/codec/twoway_codec_impl/twoway_codec_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ func NewPBWrapperTwoWayCodec(codecName constant.CodecType) (common.TwoWayCodec,

// MarshalRequest marshal interface @v to []byte
func (h *PBWrapperTwoWayCodec) MarshalRequest(v interface{}) ([]byte, error) {
argsBytes := make([][]byte, 0)
argsTypes := make([]string, 0)
reqList := v.([]interface{})
argsBytes := make([][]byte, 0, len(reqList))
argsTypes := make([]string, 0, len(reqList))
for _, value := range reqList {
data, err := h.codec.Marshal(value)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/common/constant/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const (
TRIPLE = "tri"

// DefaultHttp2ControllerReadBufferSize is default read buffer size of triple client/server
DefaultHttp2ControllerReadBufferSize = 1000000
DefaultHttp2ControllerReadBufferSize = 4096

// DefaultTimeout is default timeout seconds of triple client
DefaultTimeout = 15
Expand Down
2 changes: 1 addition & 1 deletion pkg/http2/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func skipHeader(frameData []byte) ([]byte, uint32) {
func readSplitData(ctx context.Context, rBody io.ReadCloser) chan *bytes.Buffer {
cbm := make(chan *bytes.Buffer)
go func() {
buf := make([]byte, 4098) // todo configurable
buf := make([]byte, 4096) // todo configurable
for {
splitBuffer := bytes.NewBuffer(make([]byte, 0))

Expand Down