Re: [PATCH] rev-list: estimate number of bisection step left
- From
Christian Couder <chriscool@tuxfamily.org>
- Date
- Feb 19, 2009, 05:26 UTC
- Message-ID
- <200902190626.36163.chriscool@tuxfamily.org>
- In-Reply-To
- <200902190616.18747.chriscool@tuxfamily.org>
Le jeudi 19 février 2009, Christian Couder a écrit :
Show 6 quoted lines
> So the improved algorithm could be something like:
>
> static int estimate_bisect_steps(int all)
> {
> int n, x, e;
> float p;Oops, the line above is not needed.
Show 9 quoted lines
> if (all < 3) > return 0; > > n = log2(all); > e = exp2(n); > x = all - e; > > return (e < 3 * x) ? n : n - 1 ; > }