diff options
| author | Patrick Walton <[email protected]> | 2011-05-10 14:47:28 -0700 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2011-05-10 14:48:24 -0700 |
| commit | 17daf1f9bf4e78c9f3ed8be24ef4bc15d60c744e (patch) | |
| tree | ec00fbd2224c19c7009dae0fbc555d50ca8a368e /src/comp/middle/ty.rs | |
| parent | Switch memcpy to memmove since we're willing to compile x = x and such. (diff) | |
| download | rust-17daf1f9bf4e78c9f3ed8be24ef4bc15d60c744e.tar.xz rust-17daf1f9bf4e78c9f3ed8be24ef4bc15d60c744e.zip | |
rustc: Cache intermediate results of metadata.Encode.ty_str. Shaves 30% off translation time.
Diffstat (limited to 'src/comp/middle/ty.rs')
| -rw-r--r-- | src/comp/middle/ty.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs index dfdf07d9..797b1ee0 100644 --- a/src/comp/middle/ty.rs +++ b/src/comp/middle/ty.rs @@ -55,7 +55,8 @@ type mt = rec(t ty, ast.mutability mut); type creader_cache = hashmap[tup(int,uint,uint),ty.t]; type ctxt = rec(@type_store ts, session.session sess, - creader_cache rcache); + creader_cache rcache, + hashmap[t,str] short_names_cache); type ty_ctxt = ctxt; // Needed for disambiguation from Unify.ctxt. // Convert from method type to function type. Pretty easy; we just drop @@ -227,7 +228,9 @@ fn mk_rcache() -> creader_cache { fn mk_ctxt(session.session s) -> ctxt { ret rec(ts = mk_type_store(), sess = s, - rcache = mk_rcache()); + rcache = mk_rcache(), + short_names_cache = + Map.mk_hashmap[ty.t,str](ty.hash_ty, ty.eq_ty)); } // Type constructors |