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

First specialization #123

Merged
merged 1 commit into from Aug 30, 2018
Merged

First specialization #123

merged 1 commit into from Aug 30, 2018

Conversation

@llogiq
Copy link
Contributor

llogiq commented Aug 27, 2018

I added a new specialization feature that will specialize From<&[_: Copy]> to use from_slice, which offers a nice performance boost.

Alas, I could not get any measurable perf improvement on insert_many or extend yet, so I'll leave them out for now.


This change is Reviewable

lib.rs Outdated

#[cfg(feature = "specialization")]
#[inline]
default fn from(slice: &'a [A::Item]) -> SmallVec<A> {

This comment has been minimized.

@nox

nox Aug 27, 2018

Member

Doesn't that mean that one can specialise the implementation from outside the crate? Shouldn't we be specialising an internal trait used by this impl?

This comment has been minimized.

@llogiq

llogiq Aug 27, 2018

Author Contributor

I'll add an internal SpecFrom trait then.

This comment has been minimized.

@llogiq

llogiq Aug 28, 2018

Author Contributor

Done.

@llogiq llogiq force-pushed the llogiq:specialization branch from 22eafc7 to cd47dcc Aug 27, 2018
I added a new `specialization` feature that will specialize
`From<&[_: Copy]>` to use `from_slice`, which offers a nice
performance boost.

Alas, I could not get any measurable perf improvement on
`insert_many` or `extend`, so I'll leave them out for now.
@llogiq llogiq force-pushed the llogiq:specialization branch from cd47dcc to 49c43d0 Aug 28, 2018
@llogiq
Copy link
Contributor Author

llogiq commented Aug 30, 2018

This should now be ready for merging.

@nox
Copy link
Member

nox commented Aug 30, 2018

@bors-servo
Copy link
Contributor

bors-servo commented Aug 30, 2018

📌 Commit 49c43d0 has been approved by nox

@bors-servo
Copy link
Contributor

bors-servo commented Aug 30, 2018

Testing commit 49c43d0 with merge ee5fe38...

bors-servo added a commit that referenced this pull request Aug 30, 2018
First specialization

I added a new `specialization` feature that will specialize `From<&[_: Copy]>` to use `from_slice`, which offers a nice performance boost.

Alas, I could not get any measurable perf improvement on `insert_many` or `extend` yet, so I'll leave them out for now.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-smallvec/123)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Aug 30, 2018

☀️ Test successful - status-travis
Approved by: nox
Pushing ee5fe38 to master...

@bors-servo bors-servo merged commit 49c43d0 into servo:master Aug 30, 2018
1 of 2 checks passed
1 of 2 checks passed
homu Testing commit 49c43d0fa4df549f290f1fea86447dd85b485f07 with merge ee5fe38979e6a681284ea31ba5873dbeda05887b...
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@llogiq llogiq deleted the llogiq:specialization branch Aug 30, 2018
mbrubeck added a commit to mbrubeck/rust-smallvec that referenced this pull request Nov 15, 2018
Changes in this release:

* Fix possible over-allocation in `from_slice` (servo#122)
* Optional nightly-only `specialization` feature for `from_slice`
  optimization (servo#123)
* New `from_raw_parts` constructor (servo#130)
* Documentation and testing improvements (servo#125, servo#129)
@mbrubeck mbrubeck mentioned this pull request Nov 15, 2018
bors-servo added a commit that referenced this pull request Nov 16, 2018
Version 0.6.6

Changes in this release:

* Fix possible over-allocation in `from_slice` (#122)
* Optional nightly-only `specialization` feature for `from_slice` optimization (#123)
* New `from_raw_parts` constructor (#130)
* Documentation and testing improvements (#125, #129)

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-smallvec/131)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.