diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b586808..194a4dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,11 +8,8 @@ on: env: RUST_BACKTRACE: 1 -# later -# RUSTFLAGS: -Dwarnings CARGO_TERM_COLOR: always - - rust_nightly: nightly-2022-07-23 + rust_nightly: nightly-2023-03-21 jobs: tests-pass: @@ -41,7 +38,7 @@ jobs: - '' runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v2 with: submodules: true - uses: actions-rs/toolchain@v1 @@ -55,7 +52,7 @@ jobs: name: clippy runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v2 with: submodules: true - name: Install Rust clippy @@ -71,7 +68,7 @@ jobs: miri: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v2 with: submodules: true - uses: actions-rs/toolchain@v1 @@ -82,3 +79,30 @@ jobs: cd ci chmod +x miri.sh ./miri.sh + + benchmark: + name: Benchmark + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + submodules: true + - name: Setup Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + components: rustfmt, clippy + - name: Cache cargo + uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Build benchmark + run: cargo build --release --bench benchmark + - name: Run benchmark + run: cargo bench --bench benchmark diff --git a/Cargo.toml b/Cargo.toml index 8176e2d..ca5df3e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,4 @@ [workspace] - members = [ "doublets-ffi", "doublets", @@ -12,7 +11,8 @@ members = [ # internal "integration" ] + # in global rework exclude = [ "doublets-decorators", -] \ No newline at end of file +] diff --git a/dev-deps/data-rs b/dev-deps/data-rs index 95b7d4d..6e62b15 160000 --- a/dev-deps/data-rs +++ b/dev-deps/data-rs @@ -1 +1 @@ -Subproject commit 95b7d4deb04e1ba34d2fa3187dca80cc7f62c78e +Subproject commit 6e62b15c72f1a8a03517eb4074d477a4aac83414 diff --git a/doublets/Cargo.toml b/doublets/Cargo.toml index 212707c..76f5cb8 100644 --- a/doublets/Cargo.toml +++ b/doublets/Cargo.toml @@ -20,6 +20,7 @@ description = """ """ [dependencies] +criterion = "0.3.5" tap = { version = "1.0.1" } cfg-if = { version = "1.0.0" } thiserror = { version = "1.0.30" } @@ -50,7 +51,7 @@ full = ["platform", "rayon", "small-search"] [dev-dependencies] tap = { version = "1.0.1" } rand = { version = "0.8.5" } -criterion = { version = "0.3.6" } +criterion = { version = "0.4.0" } bumpalo = { version = "3.10.0", features = ["allocator_api", "collections"] } mimalloc = { version = "0.1.29", default-features = false } rpmalloc = "0.2.0" diff --git a/doublets/benches/benchmark.rs b/doublets/benches/benchmark.rs new file mode 100644 index 0000000..368febb --- /dev/null +++ b/doublets/benches/benchmark.rs @@ -0,0 +1,15 @@ +use criterion::{black_box, criterion_group, criterion_main, Criterion}; +use data::Flow::Continue; +use doublets::{split::Store, Doublets, DoubletsExt, Links}; +use mem::Global; + +fn iter(c: &mut Criterion) { + let mut store = Store::::new(Global::new(), Global::new()).unwrap(); + + for _ in 0..1_000_000 { + store.create_point().unwrap(); + } +} + +criterion_group!(benches, iter); +criterion_main!(benches); \ No newline at end of file