You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[IMPROVED] Reduce allocations in writeMsgRecord (#6576)
The following changes are all to reduce GC pressure:
- The `hdr` array looked like it should be stack-allocated but was
actually always escaping to the heap because of the highwayhash writer,
so instead of allocating a ton of those, just preallocate space on the
underlying cache buffer instead (since that has already escaped to the
heap);
- Reuse the memory of the last checksum instead of allocating
unnecessarily there too, and use `stringToBytes` for the subject,
avoiding a further copy.
Signed-off-by: Neil Twigg <neil@nats.io>
0 commit comments