Optimize packet allocations
Instead of using QSharedPointer, use std::unique_ptr to reference
IncomingPacket. Also, allocate IncomingPacket structure and the packet
data in a single memory allocation.
Similarly, replace QSharedPointer with boost::intrusive_ptr to reference Packet and allocate packet data in a single allocation with Packet.
This reduces the number of allocations
per packet from 3 (QSharedPointer control block, IncomingPacket/Packet struct
and packet data) to just one. Additionally, for IncomingPacket, this removes atomic reference
counting implemented by QSharedPointer.
Lastly, avoid passing Packet::Ptr to PacketSocket::preProcess to skip atomic reference count increment/decrement.