[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] df: new option: --total (-c) to produce grand total (in the
From: |
Bruno Haible |
Subject: |
Re: [PATCH] df: new option: --total (-c) to produce grand total (in the same way as du) |
Date: |
Thu, 4 Sep 2008 00:28:11 +0200 |
User-agent: |
KMail/1.5.4 |
Jim Meyering wrote:
> Other opinions welcome.
I mostly agree with Eric here: gnulib's substitute does not guarantee
that values stored in a 'bool' are either 0 or 1, therefore the code that
creates 'bool' values must guarantee it.
> The question is how best to *maintain* the precondition in
> the face of future development.
By code inspection. We have no compiler warning for this kind of thing.
>> Some of the changes (& => &&) are unconditional improvements, imho.
I disagree. The & => && change inserts a conditional branch into the control
flow, with the potential to save a single memory access. I count ca. 2 CPU
cycles for a memory access and ca. 8 CPU cycles for a conditional jump,
therefore I would say that the change slows down the program a bit.
Bruno
- Re: [PATCH] df: new option: --total (-c) to produce grand total (in the same way as du), Eric Blake, 2008/09/03
- Re: [PATCH] df: new option: --total (-c) to produce grand total (in the same way as du), Jim Meyering, 2008/09/03
- Re: [PATCH] df: new option: --total (-c) to produce grand total (in the same way as du),
Bruno Haible <=
- Re: [PATCH] df: new option: --total (-c) to produce grand total (in the same way as du), Jim Meyering, 2008/09/04
- Re: [PATCH] df: new option: --total (-c) to produce grand total (in the same way as du), Ralf Wildenhues, 2008/09/04
- Re: &, &&, and CPU cycles, Bruno Haible, 2008/09/04
- Re: &, &&, and CPU cycles, Paolo Bonzini, 2008/09/05
- Re: [PATCH] df: new option: --total (-c) to produce grand total (in the same way as du), Paolo Bonzini, 2008/09/08