Re: [PATCH 5/5] oidtree: a crit-bit tree for odb_loose_cache
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 29, 2021, 14:42 UTC
- Message-ID
- <xmqqzgv8ybpg.fsf@gitster.g>
- In-Reply-To
- <20210627024718.25383-6-e@80x24.org>
Eric Wong <e@80x24.org> writes:
Show 8 quoted lines
> 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?
Show 23 quoted lines
> 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";
> + }'