Git development
 help / color / mirror / Atom feed
From: Tian Yuchen <cat@malon.dev>
To: Olamide Caleb Bello <belkid98@gmail.com>, git@vger.kernel.org
Cc: phillip.wood123@gmail.com, gitster@pobox.com,
	christian.couder@gmail.com, usmanakinyemi202@gmail.com,
	kaartic.sivaraam@gmail.com, me@ttaylorr.com
Subject: Re: [PATCH v3 1/8] environment: move "trust_ctime" into `struct repo_config_values`
Date: Fri, 22 May 2026 00:37:29 +0800	[thread overview]
Message-ID: <08efcc49-0db8-49f6-8971-633aa55eb66c@malon.dev> (raw)
In-Reply-To: <20260423165432.143598-2-belkid98@gmail.com>

Hi Bello!

On 4/24/26 00:54, Olamide Caleb Bello wrote:

The code itself looks great to me, but I have some reservations about 
the description here (in terms of why trust_ctime is eagerly parsed):

 > `core.trustctime` is parsed eagerly
 > because it is used in low‑level stat‑matching functions
 > (`match_stat_data()`), where a lazy parse could cause unexpected
 > fatal errors and complicate libification efforts.

It's true that if we use repo_config_get_bool() to parse trust_ctime, 
following the call stack downwards, there is a die() call. The terminate 
condition is that the configuration does not exist or contains invalid 
characters.

But I think there is another factor: match_stat_data() is called on a 
hot path. The following code is implemented in read-cache.c, 
refresh_index() function:

	for (i = 0; i < istate->cache_nr; i++) {
		...
		new_entry = refresh_cache_ent(istate, ce, options,
					      &cache_errno, &changed,
					      &t2_did_lstat, &t2_did_scan);
		t2_sum_lstat += t2_did_lstat;
		t2_sum_scan += t2_did_scan;
		if (new_entry == ce)
		...

The call chain: refresh_index() -> refresh_cache_ent() -> 
ie_match_stat() -> ce_match_stat_basic() -> *match_stat_data()*

Therefore, if the variable is lazily parsed, this means there will be a 
performance regression whenever the index status needs to be checked, 
e.g. 'git status'.

So, I guess it would be better to extend a bit:

'...where a lazy parse could cause unexpected fatal, and result in a 
performance regression...'

Thanks, yuchen

  reply	other threads:[~2026-05-21 16:37 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-24 12:37 [PATCH v2 0/8] repo_config_values: migrate more globals Olamide Caleb Bello
2026-03-24 12:37 ` [PATCH v2 1/8] environment: move "trust_ctime" into `struct repo_config_values` Olamide Caleb Bello
2026-04-14  8:52   ` Karthik Nayak
2026-04-14  9:35     ` Phillip Wood
2026-04-14 17:15       ` Junio C Hamano
2026-04-15 11:16       ` Karthik Nayak
2026-04-15 15:49         ` Junio C Hamano
2026-04-15 19:09           ` Karthik Nayak
2026-03-24 12:37 ` [PATCH v2 2/8] environment: move "check_stat" " Olamide Caleb Bello
2026-04-14  8:55   ` Karthik Nayak
2026-03-24 12:37 ` [PATCH v2 3/8] environment: move `zlib_compression_level` into repo_config_values Olamide Caleb Bello
2026-04-14  8:58   ` Karthik Nayak
2026-04-14 14:32     ` Bello Olamide
2026-03-24 12:37 ` [PATCH v2 4/8] environment: move "pack_compression_level" into `struct repo_config_values` Olamide Caleb Bello
2026-03-24 12:37 ` [PATCH v2 5/8] environment: move "precomposed_unicode" " Olamide Caleb Bello
2026-04-14  9:07   ` Karthik Nayak
2026-03-24 12:37 ` [PATCH v2 6/8] env: move "core_sparse_checkout_cone" " Olamide Caleb Bello
2026-03-24 12:37 ` [PATCH v2 7/8] env: put "sparse_expect_files_outside_of_patterns" in `repo_config_values` Olamide Caleb Bello
2026-03-24 12:37 ` [PATCH v2 8/8] env: move "warn_on_object_refname_ambiguity" into `repo_config_values` Olamide Caleb Bello
2026-04-14  9:10 ` [PATCH v2 0/8] repo_config_values: migrate more globals Karthik Nayak
2026-04-14 14:26   ` Bello Olamide
2026-04-23 16:08   ` [PATCH v3 " Olamide Caleb Bello
2026-04-23 16:08     ` [PATCH v3 1/8] Revert "compat/posix: introduce writev(3p) wrapper" Olamide Caleb Bello
2026-04-23 16:08     ` [PATCH v3 2/8] rust: we are way beyond 2.53 Olamide Caleb Bello
2026-04-23 16:08     ` [PATCH v3 3/8] doc: am: revert Message-ID trailer claim Olamide Caleb Bello
2026-04-23 16:08     ` [PATCH v3 4/8] doc: am: correct to full --no-message-id Olamide Caleb Bello
2026-04-23 16:08     ` [PATCH v3 5/8] CI: bump actions/checkout from 4 to 5 for rust-analysis job Olamide Caleb Bello
2026-04-23 16:08     ` [PATCH v3 6/8] gitglossary: fix indentation of sub-lists Olamide Caleb Bello
2026-04-23 16:08     ` [PATCH v3 7/8] Hopefully the final tweak before -rc2 Olamide Caleb Bello
2026-04-23 16:08     ` [PATCH v3 8/8] Git 2.54-rc2 Olamide Caleb Bello
2026-04-23 16:37     ` [PATCH v3 0/8] repo_config_values: migrate more globals Bello Olamide
2026-06-01 15:42     ` [PATCH v4 " Olamide Caleb Bello
2026-06-01 15:42       ` [PATCH v4 1/8] environment: move "trust_ctime" into `struct repo_config_values` Olamide Caleb Bello
2026-06-01 15:42       ` [PATCH v4 2/8] environment: move "check_stat" " Olamide Caleb Bello
2026-06-01 15:42       ` [PATCH v4 3/8] environment: move `zlib_compression_level` " Olamide Caleb Bello
2026-06-02  0:07         ` Junio C Hamano
2026-06-02  8:12           ` Patrick Steinhardt
2026-06-02 10:08             ` Christian Couder
2026-06-02 10:26               ` Junio C Hamano
2026-06-01 15:42       ` [PATCH v4 4/8] environment: move "pack_compression_level" " Olamide Caleb Bello
2026-06-01 15:42       ` [PATCH v4 5/8] environment: move "precomposed_unicode" " Olamide Caleb Bello
2026-06-01 23:54         ` Junio C Hamano
2026-06-01 15:42       ` [PATCH v4 6/8] environment: move "core_sparse_checkout_cone" " Olamide Caleb Bello
2026-06-01 15:42       ` [PATCH v4 7/8] environment: move "sparse_expect_files_outside_of_patterns" into `repo_config_values` Olamide Caleb Bello
2026-06-01 15:42       ` [PATCH v4 8/8] environment: move "warn_on_object_refname_ambiguity" into `struct repo_config_values` Olamide Caleb Bello
2026-06-02  0:05         ` Junio C Hamano
2026-06-02 17:09       ` [PATCH v5 0/8] repo_config_values: migrate more globals variables Olamide Caleb Bello
2026-06-02 17:09         ` [PATCH v5 1/8] environment: move "trust_ctime" into `struct repo_config_values` Olamide Caleb Bello
2026-06-02 17:09         ` [PATCH v5 2/8] environment: move "check_stat" " Olamide Caleb Bello
2026-06-02 17:09         ` [PATCH v5 3/8] environment: move `zlib_compression_level` " Olamide Caleb Bello
2026-06-02 17:09         ` [PATCH v5 4/8] environment: move "pack_compression_level" " Olamide Caleb Bello
2026-06-02 17:09         ` [PATCH v5 5/8] environment: move "precomposed_unicode" " Olamide Caleb Bello
2026-06-02 17:09         ` [PATCH v5 6/8] environment: move "core_sparse_checkout_cone" " Olamide Caleb Bello
2026-06-02 17:09         ` [PATCH v5 7/8] environment: move "sparse_expect_files_outside_of_patterns" " Olamide Caleb Bello
2026-06-02 17:09         ` [PATCH v5 8/8] environment: move "warn_on_object_refname_ambiguity" " Olamide Caleb Bello
2026-04-23 16:54   ` [PATCH v3 0/8] environment: move core config globals into repo_config_values Olamide Caleb Bello
2026-04-23 16:54     ` [PATCH v3 1/8] environment: move "trust_ctime" into `struct repo_config_values` Olamide Caleb Bello
2026-05-21 16:37       ` Tian Yuchen [this message]
2026-06-01 14:01         ` Bello Olamide
2026-04-23 16:54     ` [PATCH v3 2/8] environment: move "check_stat" " Olamide Caleb Bello
2026-04-23 16:54     ` [PATCH v3 3/8] environment: move `zlib_compression_level` " Olamide Caleb Bello
2026-04-23 16:54     ` [PATCH v3 4/8] environment: move "pack_compression_level" " Olamide Caleb Bello
2026-04-23 16:54     ` [PATCH v3 5/8] environment: move "precomposed_unicode" " Olamide Caleb Bello
2026-05-15 17:15       ` Tian Yuchen
2026-04-23 16:54     ` [PATCH v3 6/8] env: move "core_sparse_checkout_cone" " Olamide Caleb Bello
2026-04-23 16:54     ` [PATCH v3 7/8] env: move "sparse_expect_files_outside_of_patterns" into `repo_config_values` Olamide Caleb Bello
2026-04-23 16:54     ` [PATCH v3 8/8] env: move "warn_on_object_refname_ambiguity" into `struct repo_config_values` Olamide Caleb Bello
2026-04-26  0:01     ` [PATCH v3 0/8] environment: move core config globals into repo_config_values Junio C Hamano
2026-04-26  0:31       ` Bello Olamide
2026-05-11  2:56         ` Junio C Hamano
2026-06-01 21:43           ` Junio C Hamano
2026-06-01 22:24             ` 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

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

  git send-email \
    --in-reply-to=08efcc49-0db8-49f6-8971-633aa55eb66c@malon.dev \
    --to=cat@malon.dev \
    --cc=belkid98@gmail.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=kaartic.sivaraam@gmail.com \
    --cc=me@ttaylorr.com \
    --cc=phillip.wood123@gmail.com \
    --cc=usmanakinyemi202@gmail.com \
    /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