Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it inefficient to emit QByteArray?

Tags:

performance

qt

My application is a network application. Its job is to receive streams of packets (QByteArray) in which I would like to emit them as signals. Would doing so be inefficient? I'm concerned with copying of large buffers.

like image 287
sivabudh Avatar asked Dec 13 '22 22:12

sivabudh


1 Answers

QByteArray uses Copy-on-write. Which means that only the pointer is copied around, that is, until you modify the content of the QByteArray. So you should be all right if you just pass it along.

like image 71
bitc Avatar answered Dec 15 '22 12:12

bitc