File tree 2 files changed +7
-7
lines changed
2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -56,12 +56,13 @@ impl<'tcx> MonoItem<'tcx> {
56
56
}
57
57
}
58
58
59
- pub fn size_estimate ( & self , tcx : TyCtxt < ' tcx > ) -> usize {
59
+ pub fn size_estimate ( & self , _tcx : TyCtxt < ' tcx > ) -> usize {
60
60
match * self {
61
- MonoItem :: Fn ( instance ) => {
61
+ MonoItem :: Fn ( _instance ) => {
62
62
// Estimate the size of a function based on how many statements
63
63
// it contains.
64
- tcx. instance_def_size_estimate ( instance. def )
64
+ //tcx.instance_def_size_estimate(instance.def)
65
+ 1
65
66
}
66
67
// Conservatively estimate the size of a static declaration
67
68
// or assembly to be 1.
@@ -321,8 +322,7 @@ impl<'tcx> CodegenUnit<'tcx> {
321
322
}
322
323
323
324
pub fn compute_size_estimate ( & mut self , tcx : TyCtxt < ' tcx > ) {
324
- // Estimate the size of a codegen unit as (approximately) the number of MIR
325
- // statements it corresponds to.
325
+ // Estimate the size of a codegen unit as the number of items in it.
326
326
self . size_estimate = self . items . keys ( ) . map ( |mi| mi. size_estimate ( tcx) ) . sum ( ) ;
327
327
}
328
328
Original file line number Diff line number Diff line change @@ -328,9 +328,9 @@ fn merge_codegen_units<'tcx>(
328
328
// Having multiple CGUs can drastically speed up compilation. But for
329
329
// non-incremental builds, tiny CGUs slow down compilation *and* result in
330
330
// worse generated code. So we don't allow CGUs smaller than this (unless
331
- // there is just one CGU, of course). Note that CGU sizes of 100 ,000+ are
331
+ // there is just one CGU, of course). Note that CGU sizes of 3 ,000+ are
332
332
// common in larger programs, so this isn't all that large.
333
- const NON_INCR_MIN_CGU_SIZE : usize = 1800 ;
333
+ const NON_INCR_MIN_CGU_SIZE : usize = 65 ;
334
334
335
335
// Repeatedly merge the two smallest codegen units as long as:
336
336
// - we have more CGUs than the upper limit, or
You can’t perform that action at this time.
0 commit comments