On Wed, May 18, 2022 at 01:54:34PM +0200, Juan Quintela wrote: > >> Is there a really performance difference to just use: > >> > >> uint8_t buffer[size]; > >> > >> qemu_get_buffer(f, buffer, size); > >> write(fd, buffer, size); > >> > >> Or telling it otherwise, what sizes are we talking here? > > > > It depends on the device, but It can range from a few MBs to several > > GBs AFAIK. > > a few MB is ok. > > Several GB on the main migration channel without a single > header/whatever?
IIRC it iterates in multi-megabyte chunks each which gets a header. The chunking size is set by the size of the buffer mmap The overall point is that memcpying GB's is going to be taxing so we want to eliminate copies on this path, especially copies that result in more system calls. We are expecting to look into further optimization down the road here because even this is still too slow. Jason