Start fewer git processes in a switch, a status read and a preview #273

Open
opened 2026-10-30 13:23:33 -05:00 by ethan-hann · 0 comments
Owner

Left after #262 (0.9.22), which cut the git starts of a capture (first capture 8 to 5, later capture 5 to 4, watched capture 7 to 5, estimate before the first capture 1 to 0). GitStartCountTests pins the counts; switch (9), check switch (5) and status (2) did not change.

Candidates the 0.9.22 implementers looked at and left, with their reasons:

  • A switch runs diff HEAD plus ls-files -o (2 starts). One merged listing would save a start per status, check switch and switch, but diff HEAD also sees staged work and git status reads in-folder ignore files, so a straight swap changes what counts as a change. Needs a listing that keeps today's semantics, proven by behavior tests first.
  • The switch's update-index --refresh before the verify diff: reads run without git's optional locks, so only update-index writes the index. Check whether the refresh can be folded into an earlier step.
  • The empty-folder trailer read (log -1) per switch: could come from a commit read the switch already does, if one exists.
  • The case-clash ls-tree on Windows and macOS needs the whole target tree; look for a cheaper exact check (for example only when the target tree has paths that differ by case, cached per tree id).

Also still owed from #262: a before and after timing of a capture and a switch on a large seeded folder. The 0.9.22 measurement on a 3000-file folder was too noisy to claim a wall-time gain (a switch took 0.4 s in one run and 1.7 s in the next); time several runs and report the median.

Left after #262 (0.9.22), which cut the git starts of a capture (first capture 8 to 5, later capture 5 to 4, watched capture 7 to 5, estimate before the first capture 1 to 0). GitStartCountTests pins the counts; switch (9), check switch (5) and status (2) did not change. Candidates the 0.9.22 implementers looked at and left, with their reasons: - A switch runs `diff HEAD` plus `ls-files -o` (2 starts). One merged listing would save a start per status, check switch and switch, but `diff HEAD` also sees staged work and `git status` reads in-folder ignore files, so a straight swap changes what counts as a change. Needs a listing that keeps today's semantics, proven by behavior tests first. - The switch's `update-index --refresh` before the verify diff: reads run without git's optional locks, so only `update-index` writes the index. Check whether the refresh can be folded into an earlier step. - The empty-folder trailer read (`log -1`) per switch: could come from a commit read the switch already does, if one exists. - The case-clash `ls-tree` on Windows and macOS needs the whole target tree; look for a cheaper exact check (for example only when the target tree has paths that differ by case, cached per tree id). Also still owed from #262: a before and after timing of a capture and a switch on a large seeded folder. The 0.9.22 measurement on a 3000-file folder was too noisy to claim a wall-time gain (a switch took 0.4 s in one run and 1.7 s in the next); time several runs and report the median.
ethan-hann added this to the Code Cleanup milestone 2026-10-30 13:23:33 -05:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ethan-hann/SavePoint#273
No description provided.