Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd benchmarks for push, insert, extend, and pushpop #31
Conversation
| @@ -5,6 +5,8 @@ | |||
| //! Small vectors in various sizes. These store a certain number of elements inline and fall back | |||
| //! to the heap for larger allocations. | |||
|
|
|||
| #![feature(test)] | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
nipunn1313
Aug 28, 2016
•
Author
Contributor
Correct. Let me work on factoring it into a conditionally compiled feature which is disabled by default.
| fn bench_push(b: &mut Bencher) { | ||
| b.iter(|| { | ||
| let mut vec: SmallVec<[u64; 16]> = SmallVec::new(); | ||
| for x in 0..100 { |
This comment has been minimized.
This comment has been minimized.
emilio
Aug 28, 2016
Member
Also, I think the compiler will be pretty much able to optimize these loops out. IIRC there was some builtin support for black box testing for this kind of things. I think we should be able to enforce that using it, or at least confirm it's not being optimized out.
This comment has been minimized.
This comment has been minimized.
nipunn1313
Aug 28, 2016
Author
Contributor
I believe if the closure returns a value then the optimizer will not remove it.
I was empirically able to determine that the optimizer was not removing the code either way (for now), but I will include the vec return value to ensure it.
|
Looks like this on my machine (Mac book pro laptop)
Travis CI looked like this. I don't think we can really rely on its numbers though.
|
|
Any update on this? |
|
@bors-servo: r+ |
|
|
|
|
Add benchmarks for push, insert, extend, and pushpop Want to add these benchmarks so that we can more effectively detect regressions/improvements from PR's like #28 and #29. <!-- 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/31) <!-- Reviewable:end -->
nipunn1313 commentedAug 27, 2016
•
edited by larsbergstrom
Want to add these benchmarks so that we can more effectively detect regressions/improvements from PR's like #28 and #29.
This change is