]> git.lizzy.rs Git - rust.git/commit
Use a Vec instead of an HashMap for the scope hierarchy
authorAriel Ben-Yehuda <arielb1@mail.tau.ac.il>
Wed, 19 Aug 2015 22:46:28 +0000 (01:46 +0300)
committerAriel Ben-Yehuda <ariel.byd@gmail.com>
Mon, 24 Aug 2015 17:24:38 +0000 (20:24 +0300)
commitfc304384e6ed40f505fa0f04043044dd44e73118
treeb595551863601a56187c8f7b87237ac10bca2915
parent2bcc6d8ec7f525328a1e8c8ce423ac3ac015eb6d
Use a Vec instead of an HashMap for the scope hierarchy

This increases regionck performance greatly - type-checking on
librustc decreased from 9.1s to 8.1s. Because of Amdahl's law,
total performance is improved only by about 1.5% (LLVM wizards,
this is your opportunity to shine!).

before:
576.91user 4.26system 7:42.36elapsed 125%CPU (0avgtext+0avgdata 1142192maxresident)k
after:
566.50user 4.84system 7:36.84elapsed 125%CPU (0avgtext+0avgdata 1124304maxresident)k

I am somewhat worried really need to find out why we have this Red Queen's
Race going on here. Originally I suspected it may be a problem from RFC1214's
warnings, but it seems to be an effect from other changes.

However, the increase seems to be mostly in LLVM's time, so I guess
it's the LLVM wizards' problem.
17 files changed:
src/librustc/metadata/tydecode.rs
src/librustc/metadata/tyencode.rs
src/librustc/middle/astencode.rs
src/librustc/middle/cfg/construct.rs
src/librustc/middle/expr_use_visitor.rs
src/librustc/middle/free_region.rs
src/librustc/middle/infer/error_reporting.rs
src/librustc/middle/infer/region_inference/mod.rs
src/librustc/middle/region.rs
src/librustc/middle/ty.rs
src/librustc_borrowck/borrowck/check_loans.rs
src/librustc_borrowck/borrowck/gather_loans/mod.rs
src/librustc_borrowck/borrowck/mod.rs
src/librustc_borrowck/borrowck/move_data.rs
src/librustc_driver/test.rs
src/librustc_trans/trans/cleanup.rs
src/librustc_typeck/check/regionck.rs