From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoHrI-0006ea-A2 for qemu-devel@nongnu.org; Fri, 01 May 2015 16:48:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YoHrE-0003Wu-Ti for qemu-devel@nongnu.org; Fri, 01 May 2015 16:48:28 -0400 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]:37381) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoHrE-0003Wk-M7 for qemu-devel@nongnu.org; Fri, 01 May 2015 16:48:24 -0400 Received: by widdi4 with SMTP id di4so58078565wid.0 for ; Fri, 01 May 2015 13:48:14 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <5543E688.6020703@redhat.com> Date: Fri, 01 May 2015 22:48:08 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1430510112-30474-1-git-send-email-jsnow@redhat.com> <1430510112-30474-5-git-send-email-jsnow@redhat.com> In-Reply-To: <1430510112-30474-5-git-send-email-jsnow@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 4/4] libqos/ahci: Swap memread/write with bufread/write List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow , qemu-devel@nongnu.org Cc: marc.mari.barcelo@gmail.com, afaerber@suse.de, stefanha@redhat.com On 01/05/2015 21:55, John Snow wrote: > Where it makes sense, use the new faster primitives. > For generally small reads/writes such as for the PRDT > and FIS packets, stick with the more wasteful but > easier to debug memread/memwrite. > > For ahci-test; > With this patch: > real 0m4.802s > user 0m3.506s > sys 0m2.393s > > Without this series: > real 0m14.171s > user 0m12.072s > sys 0m12.527s The overhead of memread is 2, the overhead of base64 is 1.33, also base64 should have a larger cost of computing each byte. It doesn't add up. Could it be simply that calling qtest_send (and hence vsnprintf+qemu_chr_fe_write_all, neither of which are speed demons) once per byte is hideously inefficient? :) Paolo