mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Some Optimizations
1. Change outbound client structure to be smaller and more cache friendly. 2. Snapshot MaxControlLine into client structure (mcl) to avoid server opts lookup. Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -19,7 +19,7 @@ import (
|
||||
)
|
||||
|
||||
func dummyClient() *client {
|
||||
return &client{srv: New(&defaultServerOptions), msubs: -1, mpay: -1}
|
||||
return &client{srv: New(&defaultServerOptions), msubs: -1, mpay: -1, mcl: MAX_CONTROL_LINE_SIZE}
|
||||
}
|
||||
|
||||
func dummyRouteClient() *client {
|
||||
@@ -578,7 +578,7 @@ func TestParseOK(t *testing.T) {
|
||||
|
||||
func TestMaxControlLine(t *testing.T) {
|
||||
c := dummyClient()
|
||||
c.srv.opts.MaxControlLine = 8
|
||||
c.mcl = 8
|
||||
|
||||
pub := []byte("PUB foo.bar 11\r")
|
||||
err := c.parse(pub)
|
||||
|
||||
Reference in New Issue
Block a user