Skip to content

Some small simplifications - #113

Merged
bors-servo merged 1 commit into
servo:masterfrom
llogiq:simplify
Aug 7, 2018
Merged

Some small simplifications#113
bors-servo merged 1 commit into
servo:masterfrom
llogiq:simplify

Conversation

@llogiq

@llogiqllogiq commented Aug 7, 2018

Copy link
Copy Markdown
Contributor

benches show nothing out of the ordinary:

 name smallvecbench.txt ns/iter smallvecbench-new.txt ns/iter diff ns/iter diff % speedup
bench_extend 47 47 0 0.00% x 1.00
bench_extend_from_slice 41 41 0 0.00% x 1.00
bench_extend_from_slice_small 12 12 0 0.00% x 1.00
bench_extend_from_slice_vec 55 55 0 0.00% x 1.00
bench_extend_from_slice_vec_small 25 25 0 0.00% x 1.00
bench_extend_small 13 13 0 0.00% x 1.00
bench_extend_vec 66 58 -8 -12.12% x 1.14
bench_extend_vec_small 24 24 0 0.00% x 1.00
bench_from_slice 80 80 0 0.00% x 1.00
bench_from_slice_small 22 23 1 4.55% x 0.96
bench_from_slice_vec 32 30 -2 -6.25% x 1.07
bench_from_slice_vec_small 27 27 0 0.00% x 1.00
bench_insert 618 605 -13 -2.10% x 1.02
bench_insert_from_slice 85 85 0 0.00% x 1.00
bench_insert_many 177 177 0 0.00% x 1.00
bench_insert_small 119 120 1 0.84% x 0.99
bench_insert_vec 541 542 1 0.18% x 1.00
bench_insert_vec_small 123 125 2 1.63% x 0.98
bench_macro_from_elem 35 34 -1 -2.86% x 1.03
bench_macro_from_elem_small 7 7 0 0.00% x 1.00
bench_macro_from_elem_vec 40 34 -6 -15.00% x 1.18
bench_macro_from_elem_vec_small 27 27 0 0.00% x 1.00
bench_macro_from_list 21 22 1 4.76% x 0.95
bench_macro_from_list_vec 20 21 1 5.00% x 0.95
bench_push 388 386 -2 -0.52% x 1.01
bench_push_small 65 66 1 1.54% x 0.98
bench_push_vec 335 338 3 0.90% x 0.99
bench_push_vec_small 44 46 2 4.55% x 0.96
bench_pushpop 746 746 0 0.00% x 1.00
bench_pushpop_vec 247 247 0 0.00% x 1.00
bench_remove 414 411 -3 -0.72% x 1.01
bench_remove_small 89 90 1 1.12% x 0.99
bench_remove_vec 424 406 -18 -4.25% x 1.04
bench_remove_vec_small 80 81 1 1.25% x 0.99

This change is Reviewable

benches show nothing out of the ordinary:
```
name smallvecbench.txt ns/iter smallvecbench-new.txt ns/iter diff ns/iter diff % speedup
bench_extend 47 47 0 0.00% x 1.00
bench_extend_from_slice 41 41 0 0.00% x 1.00
bench_extend_from_slice_small 12 12 0 0.00% x 1.00
bench_extend_from_slice_vec 55 55 0 0.00% x 1.00
bench_extend_from_slice_vec_small 25 25 0 0.00% x 1.00
bench_extend_small 13 13 0 0.00% x 1.00
bench_extend_vec 66 58 -8 -12.12% x 1.14
bench_extend_vec_small 24 24 0 0.00% x 1.00
bench_from_slice 80 80 0 0.00% x 1.00
bench_from_slice_small 22 23 1 4.55% x 0.96
bench_from_slice_vec 32 30 -2 -6.25% x 1.07
bench_from_slice_vec_small 27 27 0 0.00% x 1.00
bench_insert 618 605 -13 -2.10% x 1.02
bench_insert_from_slice 85 85 0 0.00% x 1.00
bench_insert_many 177 177 0 0.00% x 1.00
bench_insert_small 119 120 1 0.84% x 0.99
bench_insert_vec 541 542 1 0.18% x 1.00
bench_insert_vec_small 123 125 2 1.63% x 0.98
bench_macro_from_elem 35 34 -1 -2.86% x 1.03
bench_macro_from_elem_small 7 7 0 0.00% x 1.00
bench_macro_from_elem_vec 40 34 -6 -15.00% x 1.18
bench_macro_from_elem_vec_small 27 27 0 0.00% x 1.00
bench_macro_from_list 21 22 1 4.76% x 0.95
bench_macro_from_list_vec 20 21 1 5.00% x 0.95
bench_push 388 386 -2 -0.52% x 1.01
bench_push_small 65 66 1 1.54% x 0.98
bench_push_vec 335 338 3 0.90% x 0.99
bench_push_vec_small 44 46 2 4.55% x 0.96
bench_pushpop 746 746 0 0.00% x 1.00
bench_pushpop_vec 247 247 0 0.00% x 1.00
bench_remove 414 411 -3 -0.72% x 1.01
bench_remove_small 89 90 1 1.12% x 0.99
bench_remove_vec 424 406 -18 -4.25% x 1.04
bench_remove_vec_small 80 81 1 1.25% x 0.99
```
Comment threadlib.rs
}
}
}
self.iter.next().map(|reference| unsafe { ptr::read(reference) })

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally I would suggest ptr::read(self.iter.next()?) but this requires Rust 1.22, and it's not raising the minimum Rust version for this crate yet.

@mbrubeck

Copy link
Copy Markdown
Collaborator

@bors-servo r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 4d02e41 has been approved by mbrubeck

bors-servo pushed a commit that referenced this pull request Aug 7, 2018
Some small simplifications
benches show nothing out of the ordinary:
```
name smallvecbench.txt ns/iter smallvecbench-new.txt ns/iter diff ns/iter diff % speedup
bench_extend 47 47 0 0.00% x 1.00
bench_extend_from_slice 41 41 0 0.00% x 1.00
bench_extend_from_slice_small 12 12 0 0.00% x 1.00
bench_extend_from_slice_vec 55 55 0 0.00% x 1.00
bench_extend_from_slice_vec_small 25 25 0 0.00% x 1.00
bench_extend_small 13 13 0 0.00% x 1.00
bench_extend_vec 66 58 -8 -12.12% x 1.14
bench_extend_vec_small 24 24 0 0.00% x 1.00
bench_from_slice 80 80 0 0.00% x 1.00
bench_from_slice_small 22 23 1 4.55% x 0.96
bench_from_slice_vec 32 30 -2 -6.25% x 1.07
bench_from_slice_vec_small 27 27 0 0.00% x 1.00
bench_insert 618 605 -13 -2.10% x 1.02
bench_insert_from_slice 85 85 0 0.00% x 1.00
bench_insert_many 177 177 0 0.00% x 1.00
bench_insert_small 119 120 1 0.84% x 0.99
bench_insert_vec 541 542 1 0.18% x 1.00
bench_insert_vec_small 123 125 2 1.63% x 0.98
bench_macro_from_elem 35 34 -1 -2.86% x 1.03
bench_macro_from_elem_small 7 7 0 0.00% x 1.00
bench_macro_from_elem_vec 40 34 -6 -15.00% x 1.18
bench_macro_from_elem_vec_small 27 27 0 0.00% x 1.00
bench_macro_from_list 21 22 1 4.76% x 0.95
bench_macro_from_list_vec 20 21 1 5.00% x 0.95
bench_push 388 386 -2 -0.52% x 1.01
bench_push_small 65 66 1 1.54% x 0.98
bench_push_vec 335 338 3 0.90% x 0.99
bench_push_vec_small 44 46 2 4.55% x 0.96
bench_pushpop 746 746 0 0.00% x 1.00
bench_pushpop_vec 247 247 0 0.00% x 1.00
bench_remove 414 411 -3 -0.72% x 1.01
bench_remove_small 89 90 1 1.12% x 0.99
bench_remove_vec 424 406 -18 -4.25% x 1.04
bench_remove_vec_small 80 81 1 1.25% x 0.99
```
<!-- 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/113)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 4d02e41 with merge 371531f...

@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - status-travis
Approved by: mbrubeck
Pushing 371531f to master...

@bors-servo
bors-servo merged commit 4d02e41 into servo:masterAug 7, 2018
@llogiq
llogiq deleted the simplify branch August 7, 2018 19:15
mbrubeck added a commit to mbrubeck/rust-smallvec that referenced this pull request Aug 22, 2018
Change log:
* servo#118 - optimize `from_slice`
* servo#115 - add `into_inner` method
* Some code cleanup and testing improvements (servo#112, servo#113, servo#114, servo#120)
mbrubeck added a commit to mbrubeck/rust-smallvec that referenced this pull request Aug 22, 2018
Change log:
* servo#115 - add `into_inner` method
* servo#117 - add `from_buf_and_len` and `from_buf_and_len_unchecked`
* servo#118 - optimize `from_slice`
* Some code cleanup and testing improvements (servo#112, servo#113, servo#114, servo#120)
@mbrubeckmbrubeck mentioned this pull request Aug 22, 2018
bors-servo pushed a commit that referenced this pull request Aug 22, 2018
Version 0.6.5
Change log:
* #115 - add `into_inner` method
* #117 - add `from_buf_and_len` and `from_buf_and_len_unchecked`
* #118 - optimize `from_slice`
* Some code cleanup and testing improvements (#112, #113, #114, #120)
cc @llogiq
<!-- 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/121)
<!-- Reviewable:end -->
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@llogiq@mbrubeck@bors-servo@Shnatsel