Skip to content

Add benchmarks for push, insert, extend, and pushpop #31

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

Merged
merged 2 commits into from
Sep 11, 2016

Conversation

nipunn1313
Copy link
Contributor

@nipunn1313 nipunn1313 commented Aug 27, 2016

Want to add these benchmarks so that we can more effectively detect regressions/improvements from PR's like #28 and #29.


This change is Reviewable

@@ -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)]
Copy link
Member

Choose a reason for hiding this comment

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

This won't compile in stable, will it?

Copy link
Contributor Author

@nipunn1313 nipunn1313 Aug 28, 2016

Choose a reason for hiding this comment

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

Correct. Let me work on factoring it into a conditionally compiled feature which is disabled by default.

@nipunn1313
Copy link
Contributor Author

nipunn1313 commented Aug 28, 2016

Looks like this on my machine (Mac book pro laptop)

Nipunns-MacBook-Pro:rust-smallvec nipunn$ cargo bench --verbose --features=benchmarks bench
       Fresh smallvec v0.2.0 (file:///Users/nipunn/src/rust-smallvec)
    Finished release [optimized] target(s) in 0.0 secs
     Running `/Users/nipunn/src/rust-smallvec/target/release/deps/smallvec-a59689f47ae774cb bench --bench`

running 4 tests
test bench::bench_extend  ... bench:         169 ns/iter (+/- 19)
test bench::bench_insert  ... bench:       1,201 ns/iter (+/- 267)
test bench::bench_push    ... bench:         295 ns/iter (+/- 39)
test bench::bench_pushpop ... bench:         357 ns/iter (+/- 117)

test result: ok. 0 passed; 0 failed; 0 ignored; 4 measured

Travis CI looked like this. I don't think we can really rely on its numbers though.

running 4 tests
test bench::bench_extend  ... bench:         182 ns/iter (+/- 3)
test bench::bench_insert  ... bench:       1,916 ns/iter (+/- 21)
test bench::bench_push    ... bench:         307 ns/iter (+/- 6)
test bench::bench_pushpop ... bench:         383 ns/iter (+/- 6)```

@nipunn1313
Copy link
Contributor Author

Any update on this?

@jdm
Copy link
Member

jdm commented Sep 11, 2016

@bors-servo: r+
Thanks for doing this work!

@bors-servo
Copy link
Contributor

📌 Commit 951f1d0 has been approved by jdm

@bors-servo
Copy link
Contributor

⚡ Test exempted - status

@bors-servo bors-servo merged commit 951f1d0 into servo:master Sep 11, 2016
bors-servo pushed a commit that referenced this pull request Sep 11, 2016
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 nipunn1313 deleted the bench branch September 12, 2016 00:21
Sign up for free to 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