|
From: | Paolo Bonzini |
Subject: | Re: [Qemu-devel] [PATCH RFC] qemu-file: output data directly if possible |
Date: | Mon, 10 Oct 2011 09:42:51 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2 |
On 10/10/2011 01:56 AM, Michael S. Tsirkin wrote:
qemu file currently always buffers up data before writing it out. At least for memory this is probably not a good idea: writing out to file would be cheaper. Let's do that if we can, which should be the common case. If we can't, buffer. Signed-off-by: Michael S. Tsirkin<address@hidden> --- Completely untested, this is just thinking aloud. Shouldn't the below save us a data copy in the common case, helping speed up migration?
The problem here is qemu_put_byte and friends, where the indirection of a function call would probably slow things down. In the common case, qemu_put_byte is called a lot and f->buf_index would not be zero. The way to go would probably be to merge QEMUFile and QEMUBufferedFile's two buffering layers, which also removes a copy.
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |