Skip to content
This repository has been archived by the owner on Nov 21, 2018. It is now read-only.

add all.rs, extracted from futures-rs #6

Merged
merged 1 commit into from
Aug 18, 2016

Conversation

nikomatsakis
Copy link
Contributor

This is a benchmark from @alexcrichton -- it is drawn from the new futures library, and focuses on a particular example, that can take quite some time to compile. I am about to put up a PR that improves time on this particular benchmark.

@alexcrichton
Copy link

😲

@nrc nrc merged commit 383cd14 into rust-lang-deprecated:master Aug 18, 2016
bors added a commit to rust-lang/rust that referenced this pull request Sep 1, 2016
…r=eddyb

Cache projections in trans

This introduces a cache for the results of projection and normalization in trans. This is in addition to the existing cache that is per-inference-context. Trans is an easy place to put the cache because we are guaranteed not to have type parameters and also we don't expect any failures or inference variables, so there is no need to cache or follow-up on obligations that come along with.  (As evidenced by the fact that this particular code would panic if any error occurred.)

That said, I am not sure this is 100% the best place for it; I sort of wanted a cache like we have in the fulfillment context for global names; but that cache only triggers when all subsequent obligations are satisfied, and since projections don't have an entry in the obligation jungle there is no easy place to put it. I considered caching both the result and obligations globally, but haven't really tried implementing it. It might be a good next step.

Regardless, this cache seems to have no real effect on bootstrap time (maybe a slight improvement), but on [the futures.rs test case I was looking at](rust-lang-deprecated/rustc-benchmarks#6), it improves performance quite a bit:

| phase | before | after |
| ----- | ------ | ----- |
| collection | 0.79s | 0.46s |
| translation | 6.8s | 3.2s |
| total | 11.92s | 7.15s |

r? @arielb1
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants