ieot: add Index Entry Offset Table (IEOT) extension

This patch enables addressing the CPU cost of loading the index by adding
additional data to the index that will allow us to efficiently multi-
thread the loading and conversion of cache entries.

It accomplishes this by adding an (optional) index extension that is a
table of offsets to blocks of cache entries in the index file.  To make
this work for V4 indexes, when writing the cache entries, it periodically
"resets" the prefix-compression by encoding the current entry as if the
path name for the previous entry is completely different and saves the
offset of that entry in the IEOT.  Basically, with V4 indexes, it
generates offsets into blocks of prefix-compressed entries.

Signed-off-by: Ben Peart <benpeart@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Ben Peart
2018-10-10 11:59:37 -04:00
committed by Junio C Hamano
parent abb4bb8384
commit 3255089ada
2 changed files with 211 additions and 3 deletions

View File

@ -337,3 +337,21 @@ The remaining data of each directory block is grouped by type:
SHA-1("TREE" + <binary representation of N> +
"REUC" + <binary representation of M>)
== Index Entry Offset Table
The Index Entry Offset Table (IEOT) is used to help address the CPU
cost of loading the index by enabling multi-threading the process of
converting cache entries from the on-disk format to the in-memory format.
The signature for this extension is { 'I', 'E', 'O', 'T' }.
The extension consists of:
- 32-bit version (currently 1)
- A number of index offset entries each consisting of:
- 32-bit offset from the begining of the file to the first cache entry
in this block of entries.
- 32-bit count of cache entries in this block