Re: [PATCH v2 10/21] read-cache: regenerate shared index if necessary

2016-12-26 Thread Christian Couder
On Mon, Dec 19, 2016 at 12:48 PM, Duy Nguyen wrote: > On Sat, Dec 17, 2016 at 03:55:36PM +0100, Christian Couder wrote: >> +static const int default_max_percent_split_change = 20; >> + >> +static int too_many_not_shared_entries(struct index_state *istate) >> +{ >> + int i, not_shared = 0; >> +

Re: [PATCH v2 10/21] read-cache: regenerate shared index if necessary

2016-12-19 Thread Duy Nguyen
On Sat, Dec 17, 2016 at 03:55:36PM +0100, Christian Couder wrote: > +static const int default_max_percent_split_change = 20; > + > +static int too_many_not_shared_entries(struct index_state *istate) > +{ > + int i, not_shared = 0; > + int max_split = git_config_get_max_percent_split_change(

[PATCH v2 10/21] read-cache: regenerate shared index if necessary

2016-12-17 Thread Christian Couder
When writing a new split-index and there is a big number of cache entries in the split-index compared to the shared index, it is a good idea to regenerate the shared index. By default when the ratio reaches 20%, we will push back all the entries from the split-index into a new shared index file in