Skip to content

perf: reduce mux sturct size by merging slices #862

@rueian

Description

@rueian

Currently, a mux struct contains the following 3 slices:

rueidis/mux.go

Lines 93 to 96 in fc56243

m := &mux{dst: dst, init: init, dead: dead, wireFn: wireFn,
wire: make([]atomic.Value, multiplex),
mu: make([]sync.Mutex, multiplex),
sc: make([]*singleconnect, multiplex),

They take 24*3 bytes per mux. We should merge them into one to save the struct size.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions