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

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

Open
mmatczuk opened this issue Apr 8, 2022 · 2 comments

Comments

@mmatczuk
Copy link
Contributor

mmatczuk commented Apr 8, 2022

  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
Copy link
Contributor Author

mmatczuk commented Apr 8, 2022

Alignment is correct.

@mmatczuk
Copy link
Contributor Author

mmatczuk commented Apr 8, 2022

We want to add 1 byte for flags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant