Re: [Qemu-devel] [PATCH] copy, dd: simplify and optimize NUL bytes detection

2015-10-22 Thread Bernhard Voelker
On 10/22/2015 05:17 PM, Pádraig Brady wrote: On 22/10/15 15:44, Paolo Bonzini wrote: On 22/10/2015 16:37, Eric Blake wrote: + /* Check first 16 bytes manually. */ + for (len = 0; len < 16; len++) +{ + if (! bufsize) +return true; + if (*p) +return false; +

Re: [Qemu-devel] [PATCH] copy, dd: simplify and optimize NUL bytes detection

2015-10-23 Thread Bernhard Voelker
On 10/22/2015 05:55 PM, Eric Blake wrote: On 10/22/2015 09:47 AM, Bernhard Voelker wrote: Also I suspect the extra conditions involved in using longs for just the first 16 bytes would outweigh the benefits? I.E. the first simple loop probably breaks early, and if not has the added benefit of