All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: mfick@codeaurora.org
Cc: git@vger.kernel.org, nasserg@codeaurora.org
Subject: Re: A naive proposal for preventing loose object explosions
Date: Fri, 06 Sep 2013 10:19:02 -0700	[thread overview]
Message-ID: <xmqq61udzx4p.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <54d0a7f13b53e15ad485e212057b85a3.squirrel@www.codeaurora.org> (mfick@codeaurora.org's message of "Fri, 6 Sep 2013 03:42:50 -0000")

mfick@codeaurora.org writes:

> Object lookups should likely not get any slower than if
> repack were not run, and the extra new pack might actually help
> find some objects quicker.

In general, having an extra pack, only to keep objects that you know
are available in other packs, will make _all_ object accesses, not
just the ones that are contained in that extra pack, slower.

Instead of mmapping all the .idx files for all the available
packfiles, we could build a table that records, for each packed
object, from which packfile at what offset the data is available to
optimize the access, but obviously building that in-core table will
take time, so it may not be a good trade-off to do so at runtime (a
precomputed super-.idx that we can mmap at runtime might be a good
way forward if that turns out to be the case).

> Does this sound like it would work?

Sorry, but it is unclear what problem you are trying to solve.

Is it that you do not like that "repack -A" ejects unreferenced
objects and makes it loose, which you may have many?

The loosen_unused_packed_objects() function used by "repack -A"
calls the force_object_loose() function (actually, it is the sole
caller of the function).  If you tweak the latter to stream to a
single new "graveyard" packfile and mark it as "kept until expiry",
would it solve the issue the same way but with much smaller impact?

There already is an infrastructure available to open a single output
packfile and send multiple objects to it in bulk-checkin.c, and I am
wondering if you can take advantage of the framework.  The existing
interface to it assumes that the object data is coming from a file
descriptor (the interface was built to support bulk-checkin of many
objects in an empty repository), and it needs refactoring to allow
stream_to_pack() to take different kind of data sources in the form
of stateful callback function, though.

  reply	other threads:[~2013-09-06 17:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-06  3:42 A naive proposal for preventing loose object explosions mfick
2013-09-06 17:19 ` Junio C Hamano [this message]
2013-09-06 18:12   ` Martin Fick

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=xmqq61udzx4p.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=mfick@codeaurora.org \
    --cc=nasserg@codeaurora.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.