scylla-go-driver
scylla-go-driver copied to clipboard
conn: request put compress and tracing flags to singe value and check memory alignment
Total: 0 490.97MB (flat, cum) 42.36%
159 . . }
160 . .
161 . . func (c *connReader) loop() {
162 . . c.bufw = frame.BufferWriter(&c.buf)
163 . . for {
164 . 490.97MB resp := c.recv()
165 . . if resp.StreamID == eventStreamID {
166 . . if c.handleEvent != nil {
167 . . c.handleEvent(resp)
168 . . }
169 . . continue
170 . . }
171 . .
172 . . if resp.Err != nil {
173 . . log.Printf("%s fatal receive error, closing connection due to %s", c.connString(), resp.Err)
174 . . c.connClose()
175 . . c.drainHandlers()
176 . . return
177 . . }
178 . .
179 . . c.metrics.InFlight.Dec()
180 . .
181 . 4.05kB if h := c.handler(resp.StreamID); h != nil {
182 . . h <- resp
183 . . } else {
184 . . log.Printf("%s received unknown stream ID %d, closing connection", c.connString(), resp.StreamID)
185 . . c.connClose()
186 . . c.drainHandlers()
The goal is to reduce the request size in memory representation.
Alignment is correct.
We want to add 1 byte for flags.