@@ -15,10 +15,8 @@ pub use rustc_ast::Attribute;
1515use rustc_data_structures:: flock;
1616use rustc_data_structures:: fx:: { FxHashMap , FxIndexSet } ;
1717use rustc_data_structures:: jobserver:: { self , Client } ;
18- use rustc_data_structures:: profiling:: { duration_to_secs_str, SelfProfiler , SelfProfilerRef } ;
19- use rustc_data_structures:: sync:: {
20- AtomicU64 , AtomicUsize , Lock , Lrc , OneThread , Ordering , Ordering :: SeqCst ,
21- } ;
18+ use rustc_data_structures:: profiling:: { SelfProfiler , SelfProfilerRef } ;
19+ use rustc_data_structures:: sync:: { AtomicU64 , Lock , Lrc , OneThread , Ordering :: SeqCst } ;
2220use rustc_errors:: annotate_snippet_emitter_writer:: AnnotateSnippetEmitterWriter ;
2321use rustc_errors:: emitter:: { DynEmitter , EmitterWriter , HumanReadableErrorType } ;
2422use rustc_errors:: json:: JsonEmitter ;
@@ -46,7 +44,6 @@ use std::ops::{Div, Mul};
4644use std:: path:: { Path , PathBuf } ;
4745use std:: str:: FromStr ;
4846use std:: sync:: { atomic:: AtomicBool , Arc } ;
49- use std:: time:: Duration ;
5047
5148pub struct OptimizationFuel {
5249 /// If `-zfuel=crate=n` is specified, initially set to `n`, otherwise `0`.
@@ -157,9 +154,6 @@ pub struct Session {
157154 /// Used by `-Z self-profile`.
158155 pub prof : SelfProfilerRef ,
159156
160- /// Some measurements that are being gathered during compilation.
161- pub perf_stats : PerfStats ,
162-
163157 /// Data about code being compiled, gathered during compilation.
164158 pub code_stats : CodeStats ,
165159
@@ -215,17 +209,6 @@ pub struct Session {
215209 pub expanded_args : Vec < String > ,
216210}
217211
218- pub struct PerfStats {
219- /// The accumulated time spent on computing symbol hashes.
220- pub symbol_hash_time : Lock < Duration > ,
221- /// Total number of values canonicalized queries constructed.
222- pub queries_canonicalized : AtomicUsize ,
223- /// Number of times this query is invoked.
224- pub normalize_generic_arg_after_erasing_regions : AtomicUsize ,
225- /// Number of times this query is invoked.
226- pub normalize_projection_ty : AtomicUsize ,
227- }
228-
229212#[ derive( PartialEq , Eq , PartialOrd , Ord ) ]
230213pub enum MetadataKind {
231214 None ,
@@ -883,25 +866,6 @@ impl Session {
883866 self . opts . incremental . as_ref ( ) . map ( |_| self . incr_comp_session_dir ( ) )
884867 }
885868
886- pub fn print_perf_stats ( & self ) {
887- eprintln ! (
888- "Total time spent computing symbol hashes: {}" ,
889- duration_to_secs_str( * self . perf_stats. symbol_hash_time. lock( ) )
890- ) ;
891- eprintln ! (
892- "Total queries canonicalized: {}" ,
893- self . perf_stats. queries_canonicalized. load( Ordering :: Relaxed )
894- ) ;
895- eprintln ! (
896- "normalize_generic_arg_after_erasing_regions: {}" ,
897- self . perf_stats. normalize_generic_arg_after_erasing_regions. load( Ordering :: Relaxed )
898- ) ;
899- eprintln ! (
900- "normalize_projection_ty: {}" ,
901- self . perf_stats. normalize_projection_ty. load( Ordering :: Relaxed )
902- ) ;
903- }
904-
905869 /// We want to know if we're allowed to do an optimization for crate foo from -z fuel=foo=n.
906870 /// This expends fuel if applicable, and records fuel if applicable.
907871 pub fn consider_optimizing (
@@ -1515,12 +1479,6 @@ pub fn build_session(
15151479 io,
15161480 incr_comp_session : OneThread :: new ( RefCell :: new ( IncrCompSession :: NotInitialized ) ) ,
15171481 prof,
1518- perf_stats : PerfStats {
1519- symbol_hash_time : Lock :: new ( Duration :: from_secs ( 0 ) ) ,
1520- queries_canonicalized : AtomicUsize :: new ( 0 ) ,
1521- normalize_generic_arg_after_erasing_regions : AtomicUsize :: new ( 0 ) ,
1522- normalize_projection_ty : AtomicUsize :: new ( 0 ) ,
1523- } ,
15241482 code_stats : Default :: default ( ) ,
15251483 optimization_fuel,
15261484 print_fuel,
0 commit comments