git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH/RFC v6 1/3] lstat_cache(): more cache effective symlink/directory detection

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 12, 2009, 04:05 UTC
Message-ID
<7vbpudkw2u.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1231680542-17315-2-git-send-email-barvik@broadpark.no>
Kjetil Barvik <barvik@broadpark.no> writes:
Show 12 quoted lines
> -static inline void set_pathname(int len, const char *name, struct pathname *match)
> +static inline void reset_lstat_cache(void)
>  {
> -	if (len < PATH_MAX) {
> -		match->len = len;
> -		memcpy(match->path, name, len);
> -		match->path[len] = 0;
> -	}
> +	cache.path[0] = '\0';
> +	cache.len = 0;
> +	cache.flags = 0;
>  }

I see you made this internal to the caching code, but I suspect in the long run there needs to be a way for callers that use the caching mechanism to check and then create new paths in the work tree to invalidate the cached code (namely, builtin-apply.c::write_out_results() and entry.c::checkout_entry() codepaths).

I'll queue this round to 'pu' anyway, though.
Thanks.
Previous: Kjetil BarvikNext: Kjetil Barvik
Message 3 of 5 in “git checkout: optimise away lots of lstat() calls”
  1. 0/3 git checkout: optimise away lots of lstat() callsKjetil Barvik, Jan 11, 2009
  2. 1/3 lstat_cache(): more cache effective symlink/directory detectionKjetil Barvik, Jan 11, 2009
  3. Junio C HamanoJan 12, 2009
  4. 2/3 lstat_cache(): introduce has_symlink_or_noent_leading_path() functionKjetil Barvik, Jan 11, 2009
  5. 3/3 lstat_cache(): introduce has_dirs_only_path() functionKjetil Barvik, Jan 11, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.