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 pred

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 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_send

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

2015-05-07 Thread Markus Armbruster
Eric Blake 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]

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]); >>

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 writes: > >> On 05/06/2015 11:19 AM, Markus Armbruster wrote: >>> John Snow writes: >>> On 05/06/2015 02:25 AM, Markus Armbruster wrote: > John Snow writes: > >> Instead of letting printf and friends do this for us

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

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

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 writes: > >> On 05/06/2015 02:25 AM, Markus Armbruster wrote: >>> John Snow 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 i

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

2015-05-06 Thread Markus Armbruster
John Snow writes: > On 05/06/2015 02:25 AM, Markus Armbruster wrote: >> John Snow 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 ov

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 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-05 Thread Markus Armbruster
John Snow 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 to doing our

[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 --- qtest.c | 20 tests/libqtest.c | 17