pr-1266/Abhra303/bitmap-commit-table-v5
tagged this
20 Jul 18:38
When parsing the .bitmap file, git loads all the bitmaps one by one even if some of the bitmaps are not necessary. We can remove this overhead by loading only the necessary bitmaps. A look up table extension can solve this issue. Changes since v4: * There was a CI failing test for linux-sha256 in the previous version. Fixed now. Changes since v3: * The common code from both lookup_table_get_triplet() and bsearch_triplet_by_pos are moved to lookup_table_get_triplet_by_pointer function * parameter names of triplet_cmp function is changes (as suggested by Martin) * xor_items array is now work as reusable static buffer. * I moved the filling commit_positions array part (from pack-bitmap-write.c) to bitmap_writer_finish function. Because we had to iterate two times for commit positions - one in write_selected_commits_v1 and another in write_lookup_table function. Hope this is acceptable :) * changes in performance tests (as suggested by Taylor) Changes since v2: * Log messages related issues are fixed. * pack.writeBitmapLookupTable is now by default disabled. * Documentations are improved. * xor_row is used instead of xor_pos in triplets. * In pack-bitmap-write.c, off_t * is used for offsets array (Instead of uint64_t *). * struct bitmap_lookup_table_triplet is introduced and functions Like triplet_get_offset() and triplet_get_xor_pos() are removed. * table_size is getting subtracted from index_end irrespective of the value of GIT_TEST_READ_COMMIT_TABLE. * xor stack filling loop will stop iterating if a xor bitmap is already stored/parsed. * The stack will now store bitmap_lookup_table_xor_item items Of plain xor_row. * bitmap related test files are reformatted to allow repeating of tests with bitmap extension enabled. * comments are added. Changes since v1: This is the second version which addressed all (I think) the reviews. Please notify me if some reviews are not addressed :) * The table size is decreased and the format has also changed. It now contains nr_entries triplets of size 4+8+4 bytes. Each triplet contains the following things - (1) 4 byte commit position (in the pack-index or midx) (2) 8 byte offset and (3) 4 byte xor triplet (i.e. with whose bitmap the current triplet's bitmap has to xor) position. * Performance tests are splitted into two commits. First contains the actual performance tests and second enables the pack.writeReverseIndex (as suggested by Taylor). * st_*() functions are used. * commit order is changed according to Derrick's suggestion. * Iterative approach is used instead of recursive approach to parse xor bitmaps. (As suggested by Derrick). * Some minor bug fixes of previous version. Initial version: The proposed table has: * a list of nr_entries object ids. These objects are commits that has bitmaps. Ids are stored in lexicographic order (for better searching). * a list of <offset, xor-offset> pairs (4-byte integers, network-byte order). The i'th pair denotes the offset and xor-offset(respectively) of the bitmap of i'th commit in the previous list. These two informations are necessary because only in this way bitmaps can be found without parsing all the bitmap. * a 4-byte integer for table specific flags (none exists currently). Whenever git want to parse the bitmap for a specific commit, it will first refer to the table and will look for the offset and xor-offset for that commit. Git will then try to parse the bitmap located at the offset position. The xor-offset can be used to find the xor-bitmap for the bitmap(if any). Abhradeep Chakraborty (6): Documentation/technical: describe bitmap lookup table extension pack-bitmap-write.c: write lookup table extension pack-bitmap-write: learn pack.writeBitmapLookupTable and add tests pack-bitmap: prepare to read lookup table extension p5310-pack-bitmaps.sh: enable `pack.writeReverseIndex` bitmap-lookup-table: add performance tests for lookup table Documentation/config/pack.txt | 7 + Documentation/technical/bitmap-format.txt | 39 ++ builtin/multi-pack-index.c | 7 + builtin/pack-objects.c | 8 + midx.c | 3 + midx.h | 1 + pack-bitmap-write.c | 112 ++- pack-bitmap.c | 275 +++++++- pack-bitmap.h | 14 +- t/perf/p5310-pack-bitmaps.sh | 68 +- t/perf/p5326-multi-pack-bitmaps.sh | 95 +-- t/t5310-pack-bitmaps.sh | 786 ++++++++++++---------- t/t5311-pack-bitmaps-shallow.sh | 53 +- t/t5326-multi-pack-bitmaps.sh | 421 +++++++----- t/t5327-multi-pack-bitmaps-rev.sh | 24 +- 15 files changed, 1254 insertions(+), 659 deletions(-) base-commit: 39c15e485575089eb77c769f6da02f98a55905e0 Submitted-As: https://lore.kernel.org/git/pull.1266.v5.git.1658342304.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.1266.git.1655728395.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.1266.v2.git.1656249017.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.1266.v3.git.1656924376.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.1266.v4.git.1658325913.gitgitgadget@gmail.com
Assets 2
-
2022-07-20T18:38:24Z -
2022-07-20T18:38:24Z - Loading