Re: [PATCH v7 7/9] config: make `delta_base_cache_limit` a non-global variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 20, 2024 at 05:52:58PM -0500, Taylor Blau wrote:

> On Mon, Nov 11, 2024 at 12:14:07PM +0100, Karthik Nayak wrote:
> > @@ -1697,6 +1701,9 @@ void *unpack_entry(struct repository *r, struct packed_git *p, off_t obj_offset,
> >  	struct unpack_entry_stack_ent *delta_stack = small_delta_stack;
> >  	int delta_stack_nr = 0, delta_stack_alloc = UNPACK_ENTRY_STACK_PREALLOC;
> >  	int base_from_cache = 0;
> > +	unsigned long delta_base_cache_limit = DEFAULT_DELTA_BASE_CACHE_LIMIT;
> > +
> > +	repo_config_get_ulong(r, "core.deltabasecachelimit", &delta_base_cache_limit);
> >
> >  	write_pack_access_log(p, obj_offset);
> >
> 
> Hmm. This repo_config_get_ulong() call will look for the configset entry
> in a hashmap which is faster than parsing the configuration file from
> scratch every time, but still expensive for my taste in a function as
> hot as unpack_entry().
> 
> Should this also go in the_repository->settings instead? That way we
> have a single field access instead of a hashmap lookup (with multiple
> layers of function calls between us and the actual lookup).

Good catch. I missed this one when making a similar argument for the
packed_git variables.

-Peff




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux