Re: [Qemu-devel] [PATCH v3 4/5] qtest: precompute hex nibs

2015-05-08 Thread Markus Armbruster
Eric Blake ebl...@redhat.com writes: On 05/06/2015 10:18 AM, John Snow wrote: To find out, add just buffering. Something like this in your patch instead of byte2hex(): for (i = 0; i len; i++) { -qtest_sendf(chr, %02x, data[i]); +snprintf(enc[i * 2], 2,

Re: [Qemu-devel] [PATCH v3 4/5] qtest: precompute hex nibs

2015-05-08 Thread John Snow
On 05/08/2015 02:25 AM, Markus Armbruster wrote: Eric Blake ebl...@redhat.com writes: On 05/06/2015 10:18 AM, John Snow wrote: To find out, add just buffering. Something like this in your patch instead of byte2hex(): for (i = 0; i len; i++) { -qtest_sendf(chr,

Re: [Qemu-devel] [PATCH v3 4/5] qtest: precompute hex nibs

2015-05-08 Thread Eric Blake
On 05/08/2015 10:22 AM, John Snow wrote: I'm a bit surprised - making a function call per byte generally executes more instructions than open-coding the conversion (albeit the branch prediction in the hardware probably does fairly well over long strings, since it is a tight and predictable

Re: [Qemu-devel] [PATCH v3 4/5] qtest: precompute hex nibs

2015-05-07 Thread John Snow
On 05/07/2015 02:13 AM, Markus Armbruster wrote: John Snow js...@redhat.com writes: On 05/06/2015 11:19 AM, Markus Armbruster wrote: John Snow js...@redhat.com writes: On 05/06/2015 02:25 AM, Markus Armbruster wrote: John Snow js...@redhat.com writes: Instead of letting printf and

Re: [Qemu-devel] [PATCH v3 4/5] qtest: precompute hex nibs

2015-05-07 Thread Eric Blake
On 05/06/2015 10:18 AM, John Snow wrote: To find out, add just buffering. Something like this in your patch instead of byte2hex(): for (i = 0; i len; i++) { -qtest_sendf(chr, %02x, data[i]); +snprintf(enc[i * 2], 2, %02x, data[i]); } If the

Re: [Qemu-devel] [PATCH v3 4/5] qtest: precompute hex nibs

2015-05-07 Thread Markus Armbruster
John Snow js...@redhat.com writes: On 05/06/2015 11:19 AM, Markus Armbruster wrote: John Snow js...@redhat.com writes: On 05/06/2015 02:25 AM, Markus Armbruster wrote: John Snow js...@redhat.com writes: Instead of letting printf and friends do this for us one byte at a time, fill a

Re: [Qemu-devel] [PATCH v3 4/5] qtest: precompute hex nibs

2015-05-06 Thread Markus Armbruster
John Snow js...@redhat.com writes: Instead of letting printf and friends do this for us one byte at a time, fill a buffer ourselves and then send the entire buffer in one go. This gives a moderate speed improvement over the old method. Out of curiosity: how much of the improvement is due

Re: [Qemu-devel] [PATCH v3 4/5] qtest: precompute hex nibs

2015-05-06 Thread John Snow
On 05/06/2015 02:25 AM, Markus Armbruster wrote: John Snow js...@redhat.com writes: Instead of letting printf and friends do this for us one byte at a time, fill a buffer ourselves and then send the entire buffer in one go. This gives a moderate speed improvement over the old method.

Re: [Qemu-devel] [PATCH v3 4/5] qtest: precompute hex nibs

2015-05-06 Thread John Snow
On 05/06/2015 11:19 AM, Markus Armbruster wrote: John Snow js...@redhat.com writes: On 05/06/2015 02:25 AM, Markus Armbruster wrote: John Snow js...@redhat.com writes: Instead of letting printf and friends do this for us one byte at a time, fill a buffer ourselves and then send the

Re: [Qemu-devel] [PATCH v3 4/5] qtest: precompute hex nibs

2015-05-06 Thread Markus Armbruster
John Snow js...@redhat.com writes: On 05/06/2015 02:25 AM, Markus Armbruster wrote: John Snow js...@redhat.com writes: Instead of letting printf and friends do this for us one byte at a time, fill a buffer ourselves and then send the entire buffer in one go. This gives a moderate speed

[Qemu-devel] [PATCH v3 4/5] qtest: precompute hex nibs

2015-05-05 Thread John Snow
Instead of letting printf and friends do this for us one byte at a time, fill a buffer ourselves and then send the entire buffer in one go. This gives a moderate speed improvement over the old method. Signed-off-by: John Snow js...@redhat.com --- qtest.c | 20