On Thu, Dec 8, 2022 at 8:50 AM Derrick Stolee <derrickstolee@xxxxxxxxxx> wrote: > > On 12/7/2022 6:27 PM, Junio C Hamano wrote: > > "Derrick Stolee via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes: > > > >> Writing the index is a critical action that takes place in multiple Git > >> commands. The recent performance improvements available with the sparse > >> index show how often the I/O costs around the index can affect different Git > >> commands, although reading the index takes place more often than a write. > > > > The sparse-index work is great in that it offers correctness while > > taking advantage of the knowledge of which part of the tree is > > quiescent and unused to boost performance. I am not sure a change > > to reduce file safety can be compared with it, in that one is pure > > improvement, while the other is trade-off. > > I agree that this is a trade-off, and we should both be careful about > whether or not we even make this a possibility for certain file > formats. The index is an interesting case for a couple reasons: > > 1. Writes block users. Writing the index takes place in many user- > blocking foreground operations. The speed improvement directly > impacts their use. Other file formats are typically written in > the background (commit-graph, multi-pack-index) or are super- > critical to correctness (pack-files). > > 2. Index files are short lived. It is rare that a user leaves an > index for a long time with many staged changes. That's the condition > that's required for losing an index file to cause a loss of work > (or maybe I'm missing something). Outside of staged changes, the > index can be completely destroyed and rewritten with minimal impact > to the user. > Is this information in the commit messages somewhere? I didn't see it in the cover letter. Nor did I see any other explanation in the cover letter besides "this makes it faster". I would expect such trade off or analysis of "what do we lose" to be in the cover letter, as it may not be clear otherwise. I do agree these reasons are good, but it can be confusing to later reviewers when looking back at the code for an option like this and wondering why it exists. Thanks, Jake