Commit Graph

12 Commits

Author SHA1 Message Date
Derek Collison
313dd424a3 Optimize to not allocate converting strings to []byte
Signed-off-by: Derek Collison <derek@nats.io>
2023-04-08 20:46:05 -07:00
Derek Collison
ad08ee3898 Remove unused function
Signed-off-by: Derek Collison <derek@nats.io>
2023-04-08 20:28:44 -07:00
Derek Collison
fa73b572e6 Optimize with Pool and avoid allocations on []byte cast of strings
Signed-off-by: Derek Collison <derek@nats.io>
2023-04-08 19:58:09 -07:00
Neil Twigg
68961ffedd Refactor ipQueue to use generics, reduce allocations 2023-02-21 14:50:09 +00:00
Ivan Kozlovic
c3da392832 Changes to IPQueues
Removed the warnings, instead have a sync.Map where they are
registered/unregistered and can be inspected with an undocumented
monitor page.
Added the notion of "in progress" which is the number of messages
that have beend pop()'ed. When recycle() is invoked this count
goes down.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-03-17 17:53:06 -06:00
Ivan Kozlovic
29c40c874c Adding logger for IPQueue
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-01-13 13:14:00 -07:00
Ivan Kozlovic
2ca025b33d Adapted system sendq
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-01-13 13:05:07 -07:00
Ivan Kozlovic
9f30bf00e0 [FIXED] Corrupted headers receiving from consumer with meta-only
When a consumer is configured with "meta-only" option, and the
stream was backed by a memory store, a memory corruption could
happen causing the application to receive corrupted headers.

Also replaced most of usage of `append(a[:0:0], a...)` to make
copies. This was based on this wiki:
https://github.com/go101/go101/wiki/How-to-efficiently-clone-a-slice%3F

But since Go 1.15, it is actually faster to call make+copy instead.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-12-01 10:50:15 -07:00
Derek Collison
9b73fae5bd We should not sit in place here, no measurable effect on latency in tests
Signed-off-by: Derek Collison <derek@nats.io>
2021-07-01 14:29:09 -07:00
Derek Collison
207ebd3b3d Changed stream sendq to linked list outq.
Made consumer share streams outq.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-04 17:19:50 -08:00
Derek Collison
e70e46ea4a Updates based on PR feedback
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-04 16:16:28 -08:00
Derek Collison
bfb8e3432e Move RAFT comms off internal sendq.
Move route and gateway msgs our of fast path for inbound stream msgs.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-04 14:45:34 -08:00