N-way mirror read speedup in zfsonlinux
Will Andrews
will at firepipe.net
Sun Aug 18 22:46:08 UTC 2013
On Sunday, August 18, 2013, Matthew Ahrens wrote:
>
> As I said, it is more difficult to understand because it is nonstandard.
> There are many more instances in ZFS of for loops than of do/while loops
> that could be trivially replaced with for loops, because the for loop is
> the standard way of doing iteration in this codebase.
>
> My understanding is that your argument is that the do/while is faster. If
> you can show (measure) that it is faster in important use cases, then I
> will agree that the do/while is better.
>
Not to mention:
- the change assumes the compiler isn't already optimizing the code to
behave like a do..while loop. It may do so given that a vdev_children value
of 0 would yield a zero length buffer and likely page faults for c = 0.
- for loops condense the loop conditions & iteration into a single line, so
for most cases it is clearer what the bounds of the loop are.
- we are talking about *maybe* saving a handful of instructions while
performing I/O.
--Will.
More information about the zfs-devel
mailing list