shithub: riscv

Download patch

ref: 266881b45935d644caad088549cd37697a200bd0
parent: 5af61e312772ca2a42c19f40cecf40e8d2c3e800
author: Ori Bernstein <ori@eigenstate.org>
date: Mon Sep 25 18:03:42 EDT 2023

git: replace index format for ~200x speedup

his change replaces our index format with a flat file, where
each line is in the form of:

	T qid mode path
	R qid mode path
	A qid mode path

where T is a tracked file, R is a file that's flagged for
removal, and A is a path that is added but not yet committed.
Lines may be repeated, and the last line in the file is used
to represent the status of a path.

The QID is in the index so that we can short circuit reading
the full contents if the file has not been changed. The mode
is there to avoid stats and walks through the git repository.

If the qid is NOQID or the mode is 0, then the git repository
contents are consulted to decide if the file is the same.

Tested on the 9front repo:

	Old walk:

		@{cd / && time /sys/src/cmd/git/6.owalk -q}
		0.08u 1.73s 2.82r 	 /sys/src/cmd/git/6.owalk -q  # status= DM

	New walk:

		@{cd / && time git/walk -q}
		0.05u 0.02s 0.12r 	 git/walk -q  # status= RM