Skip to content

Commit 14deb58

Browse files
ttaylorrgitster
authored andcommitted
pack-objects.h: remove outdated pahole results
The size and padding of `struct object_entry` is an important factor in determining the memory usage of `pack-objects`. For this reason, 3b13a5f (pack-objects: reorder members to shrink struct object_entry, 2018-04-14) added a comment containing some information from pahole indicating the size and padding of that struct. Unfortunately, this comment hasn't been updated since 9ac3f0e (pack-objects: fix performance issues on packing large deltas, 2018-07-22), despite the size of this struct changing many times since that commit. To see just how often the size of object_entry changes, I skimmed the first-parent history with this script: for sha in $(git rev-list --first-parent --reverse 9ac3f0e..) do echo -n "$sha " git checkout -q $sha make -s pack-objects.o 2>/dev/null pahole -C object_entry pack-objects.o | sed -n \ -e 's/\/\* size: \([0-9]*\).*/size \1/p' \ -e 's/\/\*.*padding: \([0-9]*\).*/padding \1/p' | xargs done | uniq -f1 In between each merge, the size of object_entry changes too often to record every instance here. But the important merges (along with their corresponding sizes and bit paddings) in chronological order are: ad635e8 (Merge branch 'nd/pack-objects-pack-struct', 2018-05-23) size 80 padding 4 29d9e3e (Merge branch 'nd/pack-deltify-regression-fix', 2018-08-22) size 80 padding 9 3ebdef2 (Merge branch 'jk/pack-delta-reuse-with-bitmap', 2018-09-17) size 80 padding 8 33e4ae9 (Merge branch 'bc/sha-256', 2019-01-29) size 96 padding 8 (indicating that the current size of the struct is 96 bytes, with 8 padding bits). Even though this comment was written in a good spirit, it is updated infrequently enough that it serves to confuse rather than to encourage contributors to update the appropriate values when the modify the definition of object_entry. For that reason, eliminate the confusion by removing the comment altogether. Signed-off-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e4a4b31 commit 14deb58

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

pack-objects.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,6 @@ struct object_entry {
116116
unsigned dfs_state:OE_DFS_STATE_BITS;
117117
unsigned depth:OE_DEPTH_BITS;
118118
unsigned ext_base:1; /* delta_idx points outside packlist */
119-
120-
/*
121-
* pahole results on 64-bit linux (gcc and clang)
122-
*
123-
* size: 80, bit_padding: 9 bits
124-
*
125-
* and on 32-bit (gcc)
126-
*
127-
* size: 76, bit_padding: 9 bits
128-
*/
129119
};
130120

131121
struct packing_data {

0 commit comments

Comments
 (0)