Re: [PATCH 5/5] oidtree: a crit-bit tree for odb_loose_cache
From: Junio C Hamano <hidden>
Date: 2021-06-29 14:42:10
Eric Wong [off-list ref] writes:
This saves 8K per `struct object_directory', meaning it saves around 800MB in my case involving 100K alternates (half or more of those alternates are unlikely to hold loose objects). This is implemented in two parts: a generic, allocation-free `cbtree' and the `oidtree' wrapper on top of it. The latter provides allocation using alloc_state as a memory pool to improve locality and reduce free(3) overhead.
This seems to break CI test, with "fatal: not a hexadecimal oid", perhaps because there is hardcoded 40 here?
quoted hunk
index 0000000000..bb4229210c--- /dev/null +++ b/t/t0069-oidtree.sh@@ -0,0 +1,52 @@ +#!/bin/sh + +test_description='basic tests for the oidtree implementation' +. ./test-lib.sh + +echoid () { + prefix="${1:+$1 }" + shift + while test $# -gt 0 + do + echo "$1" + shift + done | awk -v prefix="$prefix" '{ + printf("%s%s", prefix, $0); + need = 40 - length($0); + for (i = 0; i < need; i++) + printf("0"); + printf "\n"; + }'