Skip to content

Commit 002958f

Browse files
committed
Clarified why we don't pool PacketEntities
1 parent c2c7d84 commit 002958f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

demopacket.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ func (p *Parser) parsePacket() {
3232
var m proto.Message
3333
switch cmd {
3434
case int(msg.SVC_Messages_svc_PacketEntities):
35-
// TODO: Find a way to pool SVC_Messages_svc_PacketEntities
36-
// Need to make sure the message was consumed before pooling
37-
// and the message's contents will be overridden (either by protobuf or manually)
35+
// We could pool CSVCMsg_PacketEntities as they take up A LOT of the allocations
36+
// but unless we're on a system that's doing a lot of concurrent parsing there isn't really a point
37+
// as handling packets is a lot slower than creating them and we can't pool until they are handled.
3838
m = new(msg.CSVCMsg_PacketEntities)
3939

4040
case int(msg.SVC_Messages_svc_GameEventList):

0 commit comments

Comments
 (0)