mirror of
https://github.com/soypat/lneto.git
synced 2026-08-22 15:39:06 +00:00
Reduce heap allocs 2 (#46)
* reduce heap allocations in tcp logging; omit use of AppendFloat which allocates a metric sh*tton * debugheaplog: better heap statistic logging * heap: use string for pcap.Frame.Protocol * add potential to eliminate Flags.String heap alloc, remove incorrect HEAP comments * add StackAsync.DebugErr and httpraw.SetBytes * many heap alloc reductions and replacement of bytes.Equal with internal.BytesEqual
This commit is contained in:
+7
-1
@@ -216,7 +216,13 @@ func (h *Handler) Recv(incomingPacket []byte) error {
|
||||
}
|
||||
}
|
||||
if h.logenabled(internal.LevelTrace) {
|
||||
h.trace("tcp.Handler:rx-done", slog.Uint64("port", uint64(h.localPort)), slog.Uint64("remoteport", uint64(remotePort)), slog.String("seg", segIncoming.String()))
|
||||
h.trace("tcp.Handler:rx-done",
|
||||
slog.Uint64("lport", uint64(h.localPort)),
|
||||
slog.Uint64("rport", uint64(remotePort)),
|
||||
slog.Uint64("seg.seq", uint64(segIncoming.SEQ)),
|
||||
slog.Uint64("seg.ack", uint64(segIncoming.ACK)),
|
||||
slog.Uint64("seg.datalen", uint64(segIncoming.DATALEN)),
|
||||
)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user