Skip to content

Commit 031e86c

Browse files
committed
Partly disable simplified-type glue optimization due to compile-time cost.
1 parent 05587eb commit 031e86c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/comp/middle/trans.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1617,14 +1617,24 @@ fn get_static_tydesc(&@block_ctxt cx,
16171617
ret info;
16181618
}
16191619
case (none[@tydesc_info]) {
1620+
1621+
// FIXME: Use of a simplified tydesc (w/o names) removes a lot of
1622+
// generated glue, but the compile time goes way down due to
1623+
// greatly increasing the miss rate on the type_of cache elsewhere
1624+
// in this file. Experiment with other approaches to this.
1625+
1626+
/*
16201627
fn simplifier(ty.t typ) -> ty.t {
16211628
ret @rec(cname=none[str] with *typ);
16221629
}
16231630
auto f = simplifier;
16241631
auto t_simplified = ty.fold_ty(cx.fcx.lcx.ccx.tcx, f, t);
16251632
auto info = declare_tydesc(cx.fcx.lcx, t_simplified);
1626-
cx.fcx.lcx.ccx.tydescs.insert(t, info);
16271633
cx.fcx.lcx.ccx.tydescs.insert(t_simplified, info);
1634+
*/
1635+
1636+
auto info = declare_tydesc(cx.fcx.lcx, t);
1637+
cx.fcx.lcx.ccx.tydescs.insert(t, info);
16281638
define_tydesc(cx.fcx.lcx, t, ty_params);
16291639
ret info;
16301640
}

0 commit comments

Comments
 (0)