mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-16 19:14:41 -07:00
- Add atomic in client to skip check in processInboundClientMsg() if value is 0. Avoids getting the lock in fast path if not needed. - Have a timer per client instead of the global server list that was expiring: noticed a lot of contention there when running some perf/profiling tests. The timer is also not reset for every timestamp that is not yet expired since this too affects performance. Instead fires are regular interval and cleared when map is empty after a cycle. - Move processing of gw map rely on its own function (in inbound msg). I have verified that this is inlined same way as when code was directly in processInboundClientMsg. - Use string(subj[]) for prefix detection: I have verified that it is actually faster. - Builds the RMSG with appends to local buffer in handleGatewayReply() instead of using fmt.Sprintf(). Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
44 KiB
44 KiB