git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <junio@pobox.com>,
	Derrick Stolee <derrickstolee@github.com>,
	git@vger.kernel.org
Subject: Re: ds/midx-with-less-memory
Date: Wed, 27 Jul 2022 08:10:51 -0700	[thread overview]
Message-ID: <xmqqv8risi9w.fsf@gitster.g> (raw)
In-Reply-To: YuBlD3o5bYMg8f6i@coredump.intra.peff.net

Jeff King <peff@peff.net> writes:

> On Fri, Jul 22, 2022 at 06:01:10PM -0700, Junio C Hamano wrote:
>
>> * ds/midx-with-less-memory (2022-07-19) 3 commits
>>   (merged to 'next' on 2022-07-20 at 250d257c3e)
>>  + midx: reduce memory pressure while writing bitmaps
>>  + midx: extract bitmap write setup
>>  + pack-bitmap-write: use const for hashes
>> 
>>  The codepath to write multi-pack index has been taught to release a
>>  large chunk of memory that holds an array of objects in the packs,
>>  as soon as it is done with the array, to reduce memory consumption.
>> 
>>  Will merge to 'master'.
>>  source: <pull.1292.v2.git.1658244366.gitgitgadget@gmail.com>
>
> This topic looks very nice, but I think we might want this additional
> cleanup on top:
>
> -- >8 --
> Subject: [PATCH] write_midx_bitmap(): drop unused refs_snapshot parameter
>
> The refactoring in 90b2bb710d (midx: extract bitmap write setup,
> 2022-07-19) hoisted our call to find_commits_for_midx_bitmap() into the
> caller, which means we no longer need to see the refs_snapshot at all.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
>  midx.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Nice.  Is this -Wunused-parameter at work?

Thanks, will queue.

> diff --git a/midx.c b/midx.c
> index 772ab7d294..4e956cacb7 100644
> --- a/midx.c
> +++ b/midx.c
> @@ -1059,7 +1059,6 @@ static int write_midx_bitmap(const char *midx_name,
>  			     struct commit **commits,
>  			     uint32_t commits_nr,
>  			     uint32_t *pack_order,
> -			     const char *refs_snapshot,
>  			     unsigned flags)
>  {
>  	int ret, i;
> @@ -1462,7 +1461,7 @@ static int write_midx_internal(const char *object_dir,
>  
>  		if (write_midx_bitmap(midx_name.buf, midx_hash, &pdata,
>  				      commits, commits_nr, ctx.pack_order,
> -				      refs_snapshot, flags) < 0) {
> +				      flags) < 0) {
>  			error(_("could not write multi-pack bitmap"));
>  			result = 1;
>  			goto cleanup;

  parent reply	other threads:[~2022-07-27 15:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-23  1:01 What's cooking in git.git (Jul 2022, #07; Fri, 22) Junio C Hamano
2022-07-23  2:28 ` en/merge-restore-to-pristine (Was: Re: What's cooking in git.git (Jul 2022, #07; Fri, 22)) Elijah Newren
2022-07-23 13:48 ` mt/doc-config " Matheus Tavares
2022-07-25 21:56 ` tb/commit-graph-genv2-upgrade-fix Taylor Blau
2022-07-26 11:29   ` tb/commit-graph-genv2-upgrade-fix Derrick Stolee
2022-07-26 22:05 ` ds/midx-with-less-memory Jeff King
2022-07-27 11:29   ` ds/midx-with-less-memory Derrick Stolee
2022-07-27 15:10   ` Junio C Hamano [this message]
2022-07-27 19:12     ` ds/midx-with-less-memory Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqv8risi9w.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=derrickstolee@github.com \
    --cc=git@vger.kernel.org \
    --cc=junio@pobox.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).