Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert `outlives_components`' return value to a `SmallVec` outparam. #55745

Merged
merged 1 commit into from Nov 11, 2018

Conversation

@nnethercote
Copy link
Contributor

commented Nov 7, 2018

This avoids some allocations, reducing instruction counts by 1% on a
couple of benchmarks.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Nov 7, 2018

r? @matthewjasper

(rust_highfive has picked a reviewer for you, use r? to override)

@tmandry

This comment has been minimized.

Copy link
Contributor

commented Nov 7, 2018

Use `SmallVec` outparams in several functions.
This avoids some allocations, reducing instruction counts by 1% on a
couple of benchmarks.

@nnethercote nnethercote force-pushed the nnethercote:outlives_components-SmallVec branch from 868c64e to 5b2314b Nov 8, 2018

@nnethercote

This comment has been minimized.

Copy link
Contributor Author

commented Nov 8, 2018

I just pushed a new version of the code that uses SmallVec in another function (regions, which becomes push_regions), reducing allocations a bit more.

@matthewjasper
Copy link
Contributor

left a comment

One thing that looks like it could be cleaned up if you are faster than bors

}
Component::EscapingProjection(subcomponents) => {
self.components_must_outlive(origin, subcomponents, region);
self.components_must_outlive(origin, &subcomponents, region);

This comment has been minimized.

Copy link
@matthewjasper

matthewjasper Nov 10, 2018

Contributor

& looks unnecessary

@matthewjasper

This comment has been minimized.

Copy link
Contributor

commented Nov 10, 2018

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

commented Nov 10, 2018

📌 Commit 5b2314b has been approved by matthewjasper

pietroalbini added a commit to pietroalbini/rust that referenced this pull request Nov 10, 2018

Rollup merge of rust-lang#55745 - nnethercote:outlives_components-Sma…
…llVec, r=matthewjasper

Convert `outlives_components`' return value to a `SmallVec` outparam.

This avoids some allocations, reducing instruction counts by 1% on a
couple of benchmarks.

bors added a commit that referenced this pull request Nov 10, 2018

Auto merge of #55854 - pietroalbini:rollup, r=pietroalbini
Rollup of 14 pull requests

Successful merges:

 - #55745 (Convert `outlives_components`' return value to a `SmallVec` outparam.)
 - #55764 (Fix Rc/Arc allocation layout)
 - #55792 (Prevent ICE in const-prop array oob check)
 - #55799 (Removed unneeded instance of `// revisions` from a lint test)
 - #55800 (Fix ICE in `return_type_impl_trait`)
 - #55801 (NLL: Update box insensitivity test)
 - #55802 (Don't inline virtual calls (take 2))
 - #55805 (Move `static_assert!` into librustc_data_structures)
 - #55816 (Use `SmallVec` to avoid allocations in `from_decimal_string`.)
 - #55819 (Typecheck patterns of all match arms first, so we get types for bindings)
 - #55822 (ICE with #![feature(nll)] and elided lifetimes)
 - #55828 (Add missing `rustc_promotable` attribute to unsigned `min_value` and `max_value`)
 - #55839 (Fix docstring spelling mistakes)
 - #55844 (Fix documentation typos.)

Failed merges:

r? @ghost

pietroalbini added a commit to pietroalbini/rust that referenced this pull request Nov 10, 2018

Rollup merge of rust-lang#55745 - nnethercote:outlives_components-Sma…
…llVec, r=matthewjasper

Convert `outlives_components`' return value to a `SmallVec` outparam.

This avoids some allocations, reducing instruction counts by 1% on a
couple of benchmarks.

bors added a commit that referenced this pull request Nov 11, 2018

Auto merge of #55859 - pietroalbini:rollup, r=pietroalbini
Rollup of 14 pull requests

Successful merges:

 - #55687 (Take supertraits into account when calculating associated types)
 - #55745 (Convert `outlives_components`' return value to a `SmallVec` outparam.)
 - #55764 (Fix Rc/Arc allocation layout)
 - #55792 (Prevent ICE in const-prop array oob check)
 - #55799 (Removed unneeded instance of `// revisions` from a lint test)
 - #55800 (Fix ICE in `return_type_impl_trait`)
 - #55801 (NLL: Update box insensitivity test)
 - #55802 (Don't inline virtual calls (take 2))
 - #55816 (Use `SmallVec` to avoid allocations in `from_decimal_string`.)
 - #55819 (Typecheck patterns of all match arms first, so we get types for bindings)
 - #55822 (ICE with #![feature(nll)] and elided lifetimes)
 - #55828 (Add missing `rustc_promotable` attribute to unsigned `min_value` and `max_value`)
 - #55839 (Fix docstring spelling mistakes)
 - #55844 (Fix documentation typos.)

Failed merges:

r? @ghost

bors added a commit that referenced this pull request Nov 11, 2018

Auto merge of #55859 - pietroalbini:rollup, r=kennytm
Rollup of 17 pull requests

Successful merges:

 - #55630 (resolve: Filter away macro prelude in modules with `#[no_implicit_prelude]` on 2018 edition)
 - #55687 (Take supertraits into account when calculating associated types)
 - #55745 (Convert `outlives_components`' return value to a `SmallVec` outparam.)
 - #55764 (Fix Rc/Arc allocation layout)
 - #55792 (Prevent ICE in const-prop array oob check)
 - #55799 (Removed unneeded instance of `// revisions` from a lint test)
 - #55800 (Fix ICE in `return_type_impl_trait`)
 - #55801 (NLL: Update box insensitivity test)
 - #55802 (Don't inline virtual calls (take 2))
 - #55816 (Use `SmallVec` to avoid allocations in `from_decimal_string`.)
 - #55819 (Typecheck patterns of all match arms first, so we get types for bindings)
 - #55822 (ICE with #![feature(nll)] and elided lifetimes)
 - #55828 (Add missing `rustc_promotable` attribute to unsigned `min_value` and `max_value`)
 - #55839 (Fix docstring spelling mistakes)
 - #55844 (Fix documentation typos.)
 - #55845 (Set BINARYEN_TRAP_MODE=clamp)
 - #55856 (rustdoc: refactor: move all static-file include!s into a single module)

@bors bors merged commit 5b2314b into rust-lang:master Nov 11, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@nnethercote nnethercote deleted the nnethercote:outlives_components-SmallVec branch Nov 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.