Thread (175 messages) 175 messages, 5 authors, 2024-12-03

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

From: Taylor Blau <hidden>
Date: 2024-11-20 22:53:01

On Mon, Nov 11, 2024 at 12:14:07PM +0100, Karthik Nayak wrote:
quoted hunk ↗ jump to hunk
@@ -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).

Thanks,
Taylor
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help