Files
git/builtin
Jeff Hostetler 6755914abe add: use preload-index and fscache for performance
Teach "add" to use preload-index and fscache features
to improve performance on very large repositories.

During an "add", a call is made to run_diff_files()
which calls check_remove() for each index-entry.  This
calls lstat().  On Windows, the fscache code intercepts
the lstat() calls and builds a private cache using the
FindFirst/FindNext routines, which are much faster.

Somewhat independent of this, is the preload-index code
which distributes some of the start-up costs across
multiple threads.

We need to keep the call to read_cache() before parsing the
pathspecs (and hence cannot use the pathspecs to limit any preload)
because parse_pathspec() is using the index to determine whether a
pathspec is, in fact, in a submodule. If we would not read the index
first, parse_pathspec() would not error out on a path that is inside
a submodule, and t7400-submodule-basic.sh would fail with

	not ok 47 - do not add files from a submodule

We still want the nice preload performance boost, though, so we simply
call read_cache_preload(&pathspecs) after parsing the pathspecs.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2026-04-09 01:59:55 +00:00
..
2026-04-01 10:28:18 -07:00
2026-02-20 08:13:58 -08:00
2024-12-13 07:33:36 -08:00
2026-03-31 20:43:14 -07:00
2025-07-23 08:15:18 -07:00
2026-03-24 12:31:32 -07:00
2025-07-23 08:15:18 -07:00
2025-07-23 08:15:18 -07:00
2025-07-23 08:15:18 -07:00
2025-07-01 14:46:38 -07:00
2026-03-31 20:43:14 -07:00
2025-08-22 13:13:20 -07:00
2026-04-02 13:30:44 -07:00
2026-03-25 12:58:05 -07:00
2026-03-12 14:09:07 -07:00
2026-03-23 09:20:30 -07:00
2024-12-18 10:44:31 -08:00
2026-03-23 08:33:10 -07:00
2025-08-21 13:47:00 -07:00
2026-03-23 08:33:10 -07:00
2026-03-31 20:43:14 -07:00
2025-07-23 08:15:18 -07:00
2026-02-20 08:13:58 -08:00
2026-03-31 20:43:14 -07:00
2025-07-23 08:15:18 -07:00
2026-03-24 12:31:31 -07:00
2025-09-16 11:37:06 -07:00
2025-08-21 13:46:59 -07:00