N-way mirror read speedup in zfsonlinux

Steven Hartland killing at multiplay.co.uk
Sun Aug 18 15:52:16 UTC 2013


----- Original Message ----- 
From: "Matthew Ahrens" 
> On Sat, Aug 17, 2013 at 8:08 PM, Steven Hartland wrote:
> 
>> 2) do {} while() loops have their place, but only if they improve
>>>   code clarity and/or yield a significant performance benefit.  I
>>>   don't see either applying here.
>>>
>>
>> I'd have to disagree, unless using it makes it difficult to understand,
>> a do while should be used is when you know there's always going to be
>> one iteration of the loop and hence no need to test before performing
>> the first iteration.
>>
> 
> 
> I agree with Justin.  This nonstandard iteration makes it more difficult to
> understand.  I would expect there is no measurable performance benefit,
> either.

I'd like to understand why its more difficult to understand?

Its not like its a none standard language construct, its already used in
the code base in lots of place e.g.

uts/common/zmod/deflate.c:
do {...} while (--len > 0);
uts/common/dtrace/dtrace.c:
do {...} } while (--length != 0);

Compared to this case:
do {...} while (--c >= 0);

Yes its only saving one comparison per call but thats exactly what it
was added to language to do.

Not trying to be be a pain, I'm just trying to understand why using the
correct code for the job is confusing?

    Regards
    Steve

================================================
This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. 

In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337
or return the E.mail to postmaster at multiplay.co.uk.



More information about the zfs-devel mailing list