about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-09-04 00:00:09 +0000
committerbors <bors@rust-lang.org>2015-09-04 00:00:09 +0000
commit2727a8e1c06f27169be6a414623880f118551dbd (patch)
tree1208acd7fe832855a113377321c2d350600a0d65 /src/rustllvm/RustWrapper.cpp
parent1b908be9a0d7aaf8f18854db1ffef7b8df10dfeb (diff)
parentab86bf53eb2fb9289c7ce811d1615eff2c529e34 (diff)
downloadrust-2727a8e1c06f27169be6a414623880f118551dbd.tar.gz
rust-2727a8e1c06f27169be6a414623880f118551dbd.zip
Auto merge of #27984 - arielb1:misc-assemble-improvements, r=nikomatsakis
this resolves type-variables early in assemble_candidates and
bails out quickly if the self type is an inference variable (which would
fail anyway because of `assemble_candidates_from_projected_tys`).

In both these cases, `assemble_candidates_from_impls` would try to go
over all impls and match them, leading to O(`n*m`) performance. Fixing this
improves rustc type-checking performance by 10%. As type-checking is only
is 5% of compilation, this doesn't impact bootstrap times, but *does*
improve type-error-detection time which is nice.

Crates that have many dependencies and contain significant amounts of
generic functions could see a bigger perf boost. As a microbenchmark,
the crate generated by

```
echo '#![feature(rustc_private)]'
echo 'extern crate rustc_driver;'
for i in {1..1000}; do cat << _EOF_
    pub fn foo$i<T>() {
        let mut v = Vec::new();
        let _w = v.clone();
        v.push("");
    }
_EOF_
done
```

sees performance improve from 7.2 to 1.4 seconds. I imagine many crates
would fall somewhere in-between.

r? @nikomatsakis 
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions