Move generation, graph_pos to a slab
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest4 patches 2 repliesIn review
- v34 patches 9 repliesSuperseded
- v24 patches 7 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 3 patches | 16 replies | Superseded |
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | object: drop parsed_object_pool->commit_countalloc.c alloc.h blob.c +9 more | +24 | 0 replies | |
| 2/4 | commit-graph: introduce commit_graph_data_slabcommit-graph.c commit-graph.h | +78 | 0 replies | |
| 3/4 | commit: move members graph_pos, generation to a slaballoc.c blame.c bloom.c +6 more | +78 | 0 replies | |
| 4/4 | commit-graph: minimize commit_graph_data_slab accessbloom.c commit-graph.c commit-reach.c +2 more | +79 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.
Cover letter [GSOC Patch v4 0/4] Move generation, graph_pos to a slab
The struct commit is used in many contexts. However, members generation and graph_pos are only used for commit graph related operations and otherwise waste memory.
This wastage would have been more pronounced as we transition to generation nuber v2, which uses 64-bit generation number instead of current 32-bits.
While the overall test suite runs as fast as master
(series: 26m48s, master: 27m34s, faster by 2.87%), certain commands like git merge-base --is-ancestor were slowed by 40% as discovered by Szeder Gábor [1]. After minimizing commit-slab access, the slow down persists but is closer to 20%.
Derrick Stolee believes the slow down is attributable to the underlying algorithm rather than the slowness of commit-slab access [2] and we will follow-up in a later series.
Abhishek Kumar (4):
object: drop parsed_object_pool->commit_count
commit-graph: introduce commit_graph_data_slab
commit: move members graph_pos, generation to a slab
commit-graph: minimize commit_graph_data_slab access
alloc.c | 18 +++-- alloc.h | 2 +- blame.c | 2 +- blob.c | 2 +- bloom.c | 7 +- builtin/commit-graph.c | 2 +- builtin/fsck.c | 2 +- commit-graph.c | 130 ++++++++++++++++++++++++-------- commit-graph.h | 10 +++ commit-reach.c | 69 ++++++++++------- commit.c | 12 +-- commit.h | 2 - contrib/coccinelle/commit.cocci | 18 +++++ object.c | 4 +- object.h | 3 +- refs.c | 2 +- revision.c | 20 +++-- t/helper/test-reach.c | 2 +- tag.c | 2 +- tree.c | 2 +- 20 files changed, 217 insertions(+), 94 deletions(-)
Signature · 23 lines
2.27.0 Changes in v4: - Fix segfault while initializing commit_graph_data_slab. - Fix the "commit index should have unique values" more cleanly Changes in v3: - Introduce alloc commit to fix the failing diff-submodule test. - Elaborate on perforamnce and the slow down in commit message Changes in v2: - Introduce struct commit_graph_data - Merge `graph_pos`, `generation` slabs into a single, `commit_graph_data` slab. - Use graph position for an intermediate check for generation, saving the cost of initializing generation numbers. - Add an follow-up patch caching results of slab access in local variables. - Move coccinelle transformation to commit.coccinelle instead of creating new scripts. - Elaborate on removing default values from init_commit_node(). - Revert moving macro constants (e.g. COMMIT_NOT_FROM_GRAPH, GENERATION_NUMBER_ZERO0 from commit.h to commit-graph.h