@@ -413,6 +413,12 @@ impl DepGraph {
413413 self . data . as_ref ( ) . and_then ( |t| t. dep_node_debug . borrow ( ) . get ( & dep_node) . cloned ( ) )
414414 }
415415
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+
416422 pub fn serialize ( & self ) -> SerializedDepGraph {
417423 let fingerprints = self . fingerprints . borrow ( ) ;
418424 let current_dep_graph = self . data . as_ref ( ) . unwrap ( ) . current . borrow ( ) ;
@@ -737,6 +743,9 @@ pub(super) struct CurrentDepGraph {
737743 // each anon node. The session-key is just a random number generated when
738744 // the DepGraph is created.
739745 anon_id_seed : Fingerprint ,
746+
747+ total_read_count : u64 ,
748+ total_duplicate_read_count : u64 ,
740749}
741750
742751impl CurrentDepGraph {
@@ -770,6 +779,8 @@ impl CurrentDepGraph {
770779 anon_id_seed : stable_hasher. finish ( ) ,
771780 task_stack : Vec :: new ( ) ,
772781 forbidden_edge,
782+ total_read_count : 0 ,
783+ total_duplicate_read_count : 0 ,
773784 }
774785 }
775786
@@ -900,6 +911,7 @@ impl CurrentDepGraph {
900911 ref mut read_set,
901912 node : ref target,
902913 } ) => {
914+ self . total_read_count += 1 ;
903915 if read_set. insert ( source) {
904916 reads. push ( source) ;
905917
@@ -913,6 +925,8 @@ impl CurrentDepGraph {
913925 }
914926 }
915927 }
928+ } else {
929+ self . total_duplicate_read_count += 1 ;
916930 }
917931 }
918932 Some ( & mut OpenTask :: Anon {
0 commit comments