From: Junio C Hamano <junkio@cox.net>
To: Christian Couder <chriscool@tuxfamily.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/2] Delete ref $frotz by moving ref file to "deleted-$frotz~ref".
Date: Mon, 16 Oct 2006 21:41:45 -0700 [thread overview]
Message-ID: <7v4pu3tuye.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <200610170626.25654.chriscool@tuxfamily.org> (Christian Couder's message of "Tue, 17 Oct 2006 06:26:25 +0200")
Christian Couder <chriscool@tuxfamily.org> writes:
> For example, when git becomes a major SCM, there may be people working on
> big projects that want to create a new branch for each new bug and then
> delete the branch when the code on the bug branch has been integrated into
> a new release and the bug is closed.
I would say that is a very valid way to work with git,
regardless of the size of project. Now, how often would you
create such a per-bug branch and delete one, compared to the
number of operations that would require ref lookups? Your
example actually supports what I've said -- optimizing for
deletion at the cost of more expensive lookups is wrong.
> The operations that inspect project history may use a ref cache or something
> so that a lookup on the disk may not be needed. So only the ref creation or
> update rate versus delete rate may matter.
Stop and think about what you are saying. What's a ref cache?
We do not have such a beast today (unless you equate it with
packed-refs file), and you would need to design and implement
it, but think about how you make that operate. You would need
to invalidate it when you delete a ref using the deleted-ref/
approach; that's not much different from repacking packed-refs
file without the ref you just deleted, no?
Of course you can argue that instead of repacking you always
stat deleted-ref/ hierarchy; in other words, you can argue that
you can make deletion path faster by penalizing the lookup path.
So I do not think using "ref cache" (whatever it is, and however
it operates) does not change the situation a bit.
> If there are thousand of refs and a heavy I/O load, rewritting the packed
> ref file for each deletion means writing on disk something that may not fit
> in the disk cache. It may be very bad.
If the goal is to optimize for deletion path, then that is
true. My point is that we do not want to optimize for deletion
path at the expense of more costly lookup path.
next prev parent reply other threads:[~2006-10-17 4:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-14 13:39 [PATCH 1/2] Delete ref $frotz by moving ref file to "deleted-$frotz~ref" Christian Couder
2006-10-14 18:47 ` Junio C Hamano
2006-10-17 4:26 ` Christian Couder
2006-10-17 4:41 ` Junio C Hamano [this message]
2006-10-17 5:07 ` Shawn Pearce
2006-10-17 9:24 ` Jakub Narebski
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=7v4pu3tuye.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=chriscool@tuxfamily.org \
--cc=git@vger.kernel.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.