Skip to content

Commit

Permalink
Use criterion for benchmarks
Browse files Browse the repository at this point in the history
Finish benchmarking transition to criterion.rs

Put real_blackbox behind nightly, ensure 1.19

Fix TODOs

Try with 1.20

Try 1.21

Give up
  • Loading branch information
torkleyy committed Feb 18, 2018
1 parent dd81261 commit 8eb119c
Show file tree
Hide file tree
Showing 9 changed files with 548 additions and 179 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Generated by Cargo
/target/
Cargo.lock
.criterion

# Generated by mdbook
/book/book/
Expand Down
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
language: rust
rust:
- nightly
- beta
- stable

cache:
Expand All @@ -16,8 +17,8 @@ before_script:
- export PATH="$PATH:$HOME/.cargo/bin"

script:
- cargo build --features="common,serde,rudy" --verbose
- cargo test --features="common,serde,rudy" --verbose
- cargo build --verbose --features "common serde rudy"
- cargo test --verbose --features "common serde rudy"
- if [ "$TRAVIS_RUST_VERSION" == "nightly" ]; then
cargo build --all-features --verbose;
cargo test --all-features --verbose;
Expand Down
13 changes: 12 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ features = ["common", "serde"]

[dev-dependencies]
cgmath = { version = "0.14", features = ["eders"] }
criterion = "0.2"
ron = "0.1.3"
rand = "0.3"
serde_json = "1.0"
Expand Down Expand Up @@ -79,6 +80,16 @@ required-features = ["serde"]
name = "saveload"
required-features = ["serde"]

[[bench]]
name = "benches_main"
harness = false

[[bench]]
name = "parallel"

[[bench]]
name = "world"
harness = false

[workspace]
members = ["specs-derive"]

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Unlike most other ECS libraries out there, it provides
other and you can use barriers to force several stages in system execution
* high performance for real-world applications

Minimum Rust version: 1.21

## [Link to the book][book]

[book]: https://slide-rs.github.io/specs/
Expand Down
26 changes: 26 additions & 0 deletions benches/benches_main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#![feature(test)]

#[macro_use]
extern crate criterion;
extern crate specs;
extern crate test;

macro_rules! group {
($name:ident,$($benches:path),*) => {
pub fn $name(c: &mut Criterion) {
$(
$benches(c);
)*
}
};
}

mod storage_cmp;
mod storage_sparse;

pub use test::black_box;

use storage_cmp::benches_storages;
use storage_sparse::benches_sparse;

criterion_main!(benches_storages, benches_sparse);
130 changes: 0 additions & 130 deletions benches/storage.rs

This file was deleted.

Loading

0 comments on commit 8eb119c

Please sign in to comment.