@@ -44,15 +44,24 @@ pub(crate) mod function {
44
44
others : & [ ObjectId ] ,
45
45
graph : & mut Graph < ' _ , ' _ , Flags > ,
46
46
) -> Result < Option < Vec < ObjectId > > , Error > {
47
- let _span = gix_trace:: coarse!( "gix_revision::merge_base()" , ?first, ?others, ) ;
47
+ let _span = gix_trace:: coarse!(
48
+ "gix_revision::merge_base()" ,
49
+ ?first,
50
+ ?others,
51
+ paint_graph_size = gix_trace:: field:: Empty ,
52
+ cleanup_graph_size = gix_trace:: field:: Empty ,
53
+ ) ;
48
54
if others. is_empty ( ) || others. contains ( & first) {
49
55
return Ok ( Some ( vec ! [ first] ) ) ;
50
56
}
51
57
58
+ graph. clear ( ) ;
52
59
let bases = paint_down_to_common ( first, others, graph) ?;
60
+ _span. record ( "paint_graph_size" , gix_trace:: field:: display ( graph. len ( ) ) ) ;
53
61
graph. clear ( ) ;
54
62
55
63
let bases = remove_redundant ( & bases, graph) ?;
64
+ _span. record ( "cleanup_graph_size" , gix_trace:: field:: display ( graph. len ( ) ) ) ;
56
65
Ok ( ( !bases. is_empty ( ) ) . then_some ( bases) )
57
66
}
58
67
@@ -62,6 +71,7 @@ pub(crate) mod function {
62
71
commits : & [ ( ObjectId , GenThenTime ) ] ,
63
72
graph : & mut Graph < ' _ , ' _ , Flags > ,
64
73
) -> Result < Vec < ObjectId > , Error > {
74
+ let _span = gix_trace:: detail!( "gix_revision::remove_redundant()" , num_commits = %commits. len( ) ) ;
65
75
if commits. is_empty ( ) {
66
76
return Ok ( Vec :: new ( ) ) ;
67
77
}
@@ -217,11 +227,10 @@ pub(crate) mod function {
217
227
type Error = gix_object:: decode:: Error ;
218
228
219
229
fn try_from ( commit : LazyCommit < ' _ , ' _ > ) -> Result < Self , Self :: Error > {
230
+ let ( generation, timestamp) = commit. generation_and_timestamp ( ) ?;
220
231
Ok ( GenThenTime {
221
- generation : commit
222
- . generation ( )
223
- . unwrap_or ( gix_commitgraph:: GENERATION_NUMBER_INFINITY ) ,
224
- time : commit. committer_timestamp ( ) ?,
232
+ generation : generation. unwrap_or ( gix_commitgraph:: GENERATION_NUMBER_INFINITY ) ,
233
+ time : timestamp,
225
234
} )
226
235
}
227
236
}
0 commit comments