Git fork

pack-bitmap: extra trace2 information

Add some extra trace2 lines to capture the number of bitmap lookups that
are hits versus misses, as well as the number of reachability roots that
have bitmap coverage (versus those that do not).

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Taylor Blau and committed by
Junio C Hamano
25163f50 11d45a6e

+25 -1
+25 -1
pack-bitmap.c
··· 116 116 117 117 static int pseudo_merges_satisfied_nr; 118 118 static int pseudo_merges_cascades_nr; 119 + static int existing_bitmaps_hits_nr; 120 + static int existing_bitmaps_misses_nr; 121 + static int roots_with_bitmaps_nr; 122 + static int roots_without_bitmaps_nr; 119 123 120 124 static struct ewah_bitmap *lookup_stored_bitmap(struct stored_bitmap *st) 121 125 { ··· 1040 1044 1041 1045 partial = bitmap_for_commit(bitmap_git, commit); 1042 1046 if (partial) { 1047 + existing_bitmaps_hits_nr++; 1048 + 1043 1049 bitmap_or_ewah(data->base, partial); 1044 1050 return 0; 1045 1051 } 1052 + 1053 + existing_bitmaps_misses_nr++; 1046 1054 1047 1055 bitmap_set(data->base, bitmap_pos); 1048 1056 if (apply_pseudo_merges_for_commit_1(bitmap_git, data->base, commit, ··· 1099 1107 { 1100 1108 struct ewah_bitmap *or_with = bitmap_for_commit(bitmap_git, commit); 1101 1109 1102 - if (!or_with) 1110 + if (!or_with) { 1111 + existing_bitmaps_misses_nr++; 1103 1112 return 0; 1113 + } 1114 + 1115 + existing_bitmaps_hits_nr++; 1104 1116 1105 1117 if (!*base) 1106 1118 *base = ewah_to_bitmap(or_with); ··· 1407 1419 object->flags &= ~UNINTERESTING; 1408 1420 add_pending_object(revs, object, ""); 1409 1421 needs_walk = 1; 1422 + 1423 + roots_without_bitmaps_nr++; 1410 1424 } else { 1411 1425 object->flags |= SEEN; 1426 + 1427 + roots_with_bitmaps_nr++; 1412 1428 } 1413 1429 } 1414 1430 ··· 1975 1991 pseudo_merges_satisfied_nr); 1976 1992 trace2_data_intmax("bitmap", the_repository, "pseudo_merges_cascades", 1977 1993 pseudo_merges_cascades_nr); 1994 + trace2_data_intmax("bitmap", the_repository, "bitmap/hits", 1995 + existing_bitmaps_hits_nr); 1996 + trace2_data_intmax("bitmap", the_repository, "bitmap/misses", 1997 + existing_bitmaps_misses_nr); 1998 + trace2_data_intmax("bitmap", the_repository, "bitmap/roots_with_bitmap", 1999 + roots_with_bitmaps_nr); 2000 + trace2_data_intmax("bitmap", the_repository, "bitmap/roots_without_bitmap", 2001 + roots_without_bitmaps_nr); 1978 2002 1979 2003 return bitmap_git; 1980 2004