From: John Snow <jsnow@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: marc.mari.barcelo@gmail.com, afaerber@suse.de, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 4/4] libqos/ahci: Swap memread/write with bufread/write
Date: Fri, 01 May 2015 20:13:38 -0400 [thread overview]
Message-ID: <554416B2.50904@redhat.com> (raw)
In-Reply-To: <5543E688.6020703@redhat.com>
On 05/01/2015 04:48 PM, Paolo Bonzini wrote:
>
>
> 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
>
I wrote a loop to batch the ascii-hex conversion instead of letting
printf do it; then ran some more very, very scientific tests:
memset alone:
real 0m10.888s
user 0m9.303s
sys 0m9.146s
send-batching:
real 0m6.541s
user 0m5.027s
sys 0m4.941s
memset+batching+b64:
real 0m3.675s
user 0m2.582s
sys 0m1.718s
So it still seems as if the b64 batching is a strict improvement
speed-wise. I'll send the non-b64 batching patch separately later,
unless you have thoughts otherwise.
--js
next prev parent reply other threads:[~2015-05-02 0:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-01 19:55 [Qemu-devel] [PATCH v2 0/4] qtest: base64 r/w and faster memset John Snow
2015-05-01 19:55 ` [Qemu-devel] [PATCH v2 1/4] qtest: allow arbitrarily long sends John Snow
2015-05-01 19:55 ` [Qemu-devel] [PATCH v2 2/4] qtest: Add base64 encoded read/write John Snow
2015-05-01 19:55 ` [Qemu-devel] [PATCH v2 3/4] qtest: add memset to qtest protocol John Snow
2015-05-01 19:55 ` [Qemu-devel] [PATCH v2 4/4] libqos/ahci: Swap memread/write with bufread/write John Snow
2015-05-01 20:48 ` Paolo Bonzini
2015-05-01 21:04 ` John Snow
2015-05-02 0:13 ` John Snow [this message]
2015-05-05 10:35 ` Paolo Bonzini
2015-05-05 15:48 ` John Snow
2015-05-05 16:19 ` Paolo Bonzini
2015-05-05 16:26 ` John Snow
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=554416B2.50904@redhat.com \
--to=jsnow@redhat.com \
--cc=afaerber@suse.de \
--cc=marc.mari.barcelo@gmail.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).