attempt to speed up the deltification for big files
commitfcece7180725bba9a781eaa892af379b1986208b
authorOmar Polo <op@omarpolo.com>
Mon, 26 Feb 2024 16:25:15 +0000 (26 16:25 +0000)
committerOmar Polo <op@omarpolo.com>
Mon, 26 Feb 2024 16:25:15 +0000 (26 16:25 +0000)
tree6d52d0495ea2103f2608e5ee979c2856e74b4941
parentf9e9269513c7ee687c46d6060a784a9ca11646ce
attempt to speed up the deltification for big files

The current hash table perform poorly on big files due to a small
resize step that pushes the table to its limits continuously.
Instead, to have both a better performing hash table and keep the
memory consumption low, save the blocks in an array and use the
hash table as index.  Then, use a more generous resizing scheme
that guarantees the good properties of the hash table.

To avoid having to rebuild the table when the array is resized,
save the indexes in the table, and to further reduce the memory
consumption use 32 bit indices.  On amd64 this means that each slot
is 4 bytes instead of 8 for a pointer or 24 for a struct
got_deltify_block.

ok stsp@
lib/deltify.c
lib/got_lib_deltify.h