Re: [RFC PATCH 11/13] commit-reach: make can_all_from_reach... linear

2018-06-29 Thread Stefan Beller
On Fri, Jun 29, 2018 at 9:13 AM Derrick Stolee wrote: > > The can_all_from_reach_with_flags() algorithm is currently quadratic in > the worst case, because it calls the reachable() method for every 'from' > without tracking which commits have already been walked or which can > already reach a comm

[RFC PATCH 11/13] commit-reach: make can_all_from_reach... linear

2018-06-29 Thread Derrick Stolee
The can_all_from_reach_with_flags() algorithm is currently quadratic in the worst case, because it calls the reachable() method for every 'from' without tracking which commits have already been walked or which can already reach a commit in 'to'. Rewrite the algorithm to walk each commit a constant