@@ -413,6 +413,12 @@ impl DepGraph {
413
413
self . data . as_ref ( ) . and_then ( |t| t. dep_node_debug . borrow ( ) . get ( & dep_node) . cloned ( ) )
414
414
}
415
415
416
+ pub fn edge_deduplication_data ( & self ) -> ( u64 , u64 ) {
417
+ let current_dep_graph = self . data . as_ref ( ) . unwrap ( ) . current . borrow ( ) ;
418
+
419
+ ( current_dep_graph. total_read_count , current_dep_graph. total_duplicate_read_count )
420
+ }
421
+
416
422
pub fn serialize ( & self ) -> SerializedDepGraph {
417
423
let fingerprints = self . fingerprints . borrow ( ) ;
418
424
let current_dep_graph = self . data . as_ref ( ) . unwrap ( ) . current . borrow ( ) ;
@@ -737,6 +743,9 @@ pub(super) struct CurrentDepGraph {
737
743
// each anon node. The session-key is just a random number generated when
738
744
// the DepGraph is created.
739
745
anon_id_seed : Fingerprint ,
746
+
747
+ total_read_count : u64 ,
748
+ total_duplicate_read_count : u64 ,
740
749
}
741
750
742
751
impl CurrentDepGraph {
@@ -770,6 +779,8 @@ impl CurrentDepGraph {
770
779
anon_id_seed : stable_hasher. finish ( ) ,
771
780
task_stack : Vec :: new ( ) ,
772
781
forbidden_edge,
782
+ total_read_count : 0 ,
783
+ total_duplicate_read_count : 0 ,
773
784
}
774
785
}
775
786
@@ -900,6 +911,7 @@ impl CurrentDepGraph {
900
911
ref mut read_set,
901
912
node : ref target,
902
913
} ) => {
914
+ self . total_read_count += 1 ;
903
915
if read_set. insert ( source) {
904
916
reads. push ( source) ;
905
917
@@ -913,6 +925,8 @@ impl CurrentDepGraph {
913
925
}
914
926
}
915
927
}
928
+ } else {
929
+ self . total_duplicate_read_count += 1 ;
916
930
}
917
931
}
918
932
Some ( & mut OpenTask :: Anon {
0 commit comments