Game Development Community

Why aren't NetEvent objects allocated using ClassChunker?

by Kirby Zhang · in Torque Game Engine · 08/12/2006 (1:41 am) · 1 replies

When an EventConnection receives a NetEvent object, I notice that it ends up being created with the templatized method NetClassRepInstance::create(), which allocates the object with "new". It seems to me using new for such a frequently created object can cause performance problems, the very type ClassChunker is designed to solve?

With no personal experience using ClassChunker, can anyone tell me if there's a good reason it isn't used here?

Kirby

#1
08/12/2006 (4:27 pm)
Well, ClassChunker is used for instances of the same class type -- whereas there can be many different sublcasses of each NetEvent. In practice there aren't really that many NetEvents that get sent in a single packet - you're talking about maybe dozens per second, which shouldn't be a problem for even the regular memory allocator.