scylla-go-driver icon indicating copy to clipboard operation
scylla-go-driver copied to clipboard

conn: request put compress and tracing flags to singe value and check memory alignment

Open mmatczuk opened this issue 3 years ago • 2 comments

  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.

mmatczuk avatar Apr 08 '22 14:04 mmatczuk

Alignment is correct.

mmatczuk avatar Apr 08 '22 14:04 mmatczuk

We want to add 1 byte for flags.

mmatczuk avatar Apr 08 '22 14:04 mmatczuk