@@ -15,10 +15,8 @@ pub use rustc_ast::Attribute;
15
15
use rustc_data_structures:: flock;
16
16
use rustc_data_structures:: fx:: { FxHashMap , FxIndexSet } ;
17
17
use 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 } ;
22
20
use rustc_errors:: annotate_snippet_emitter_writer:: AnnotateSnippetEmitterWriter ;
23
21
use rustc_errors:: emitter:: { DynEmitter , EmitterWriter , HumanReadableErrorType } ;
24
22
use rustc_errors:: json:: JsonEmitter ;
@@ -46,7 +44,6 @@ use std::ops::{Div, Mul};
46
44
use std:: path:: { Path , PathBuf } ;
47
45
use std:: str:: FromStr ;
48
46
use std:: sync:: { atomic:: AtomicBool , Arc } ;
49
- use std:: time:: Duration ;
50
47
51
48
pub struct OptimizationFuel {
52
49
/// If `-zfuel=crate=n` is specified, initially set to `n`, otherwise `0`.
@@ -157,9 +154,6 @@ pub struct Session {
157
154
/// Used by `-Z self-profile`.
158
155
pub prof : SelfProfilerRef ,
159
156
160
- /// Some measurements that are being gathered during compilation.
161
- pub perf_stats : PerfStats ,
162
-
163
157
/// Data about code being compiled, gathered during compilation.
164
158
pub code_stats : CodeStats ,
165
159
@@ -215,17 +209,6 @@ pub struct Session {
215
209
pub expanded_args : Vec < String > ,
216
210
}
217
211
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
-
229
212
#[ derive( PartialEq , Eq , PartialOrd , Ord ) ]
230
213
pub enum MetadataKind {
231
214
None ,
@@ -883,25 +866,6 @@ impl Session {
883
866
self . opts . incremental . as_ref ( ) . map ( |_| self . incr_comp_session_dir ( ) )
884
867
}
885
868
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
-
905
869
/// We want to know if we're allowed to do an optimization for crate foo from -z fuel=foo=n.
906
870
/// This expends fuel if applicable, and records fuel if applicable.
907
871
pub fn consider_optimizing (
@@ -1515,12 +1479,6 @@ pub fn build_session(
1515
1479
io,
1516
1480
incr_comp_session : OneThread :: new ( RefCell :: new ( IncrCompSession :: NotInitialized ) ) ,
1517
1481
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
- } ,
1524
1482
code_stats : Default :: default ( ) ,
1525
1483
optimization_fuel,
1526
1484
print_fuel,
0 commit comments