From: Junio C Hamano <junkio@cox.net>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: git@vger.kernel.org, Alex Riesen <raa.lkml@gmail.com>
Subject: Re: [PATCH] Avoid accessing a slow working copy during diffcore operations.
Date: Fri, 15 Dec 2006 22:03:21 -0800 [thread overview]
Message-ID: <7vpsakl6mu.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <20061214111557.GA24297@spearce.org> (Shawn O. Pearce's message of "Thu, 14 Dec 2006 06:15:57 -0500")
"Shawn O. Pearce" <spearce@spearce.org> writes:
> If Git is compiled with NO_FAST_WORKING_DIRECTORY set then we will
> avoid looking at the working directory when the blob in question
> is available within a packfile and the caller doesn't need the data
> unpacked into a temporary file.
I'd take the patch as is, but...
> -static int work_tree_matches(const char *name, const unsigned char *sha1)
> +static int work_tree_matches(const char *name, const unsigned char *sha1, int want_file)
this feels wrong. It is not about "work tree matches" anymore.
reuse_worktree_copy(), perhaps.
> @@ -1193,6 +1193,20 @@ static int work_tree_matches(const char *name, const unsigned char *sha1)
> if (!active_cache)
> return 0;
>
> +#ifdef NO_FAST_WORKING_DIRECTORY
> + /* We want to avoid the working directory if our caller
> + * doesn't need the data in a normal file, this system
> + * is rather slow with its stat/open/mmap/close syscalls,
> + * and the object is contained in a pack file. The pack
> + * is probably already open and will be faster to obtain
> + * the data through than the working directory. Loose
> + * objects however would tend to be slower as they need
> + * to be individually opened and inflated.
> + */
> + if (!want_file && has_sha1_pack(sha1, NULL))
> + return 0;
> +#endif
> +
Also I'd prefer doing this without #ifdef;
if (defined(NO_FAST_WORKING_DIRECTORY) &&
!want_file && has_sha1_pack(sha1, NULL))
return 0;
next prev parent reply other threads:[~2006-12-16 6:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-14 11:15 [PATCH] Avoid accessing a slow working copy during diffcore operations Shawn O. Pearce
2006-12-14 13:57 ` Alex Riesen
2006-12-14 14:12 ` Johannes Schindelin
2006-12-14 14:49 ` Alex Riesen
2006-12-14 15:37 ` Johannes Schindelin
2006-12-15 9:55 ` Jakub Narebski
2006-12-15 15:05 ` Shawn Pearce
2006-12-16 6:03 ` Junio C Hamano [this message]
2006-12-16 11:54 ` Johannes Schindelin
2006-12-16 13:38 ` Junio C Hamano
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vpsakl6mu.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--cc=raa.lkml@gmail.com \
--cc=spearce@spearce.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).