diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f401f1f7..73958355 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -46,48 +46,24 @@ jobs: with: command: fetch - - name: Fetch benchmarks - uses: actions-rs/cargo@v1 - with: - command: fetch - args: --manifest-path benchmarks/Cargo.toml - - name: Build uses: actions-rs/cargo@v1 with: command: build args: --all-targets - - name: Build benchmarks - uses: actions-rs/cargo@v1 - with: - command: build - args: --manifest-path benchmarks/Cargo.toml --all-targets - - name: Check uses: actions-rs/cargo@v1 with: command: clippy args: --all-targets -- -D warnings - - name: Check benchmarks - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --manifest-path benchmarks/Cargo.toml --all-targets -- -D warnings - - name: Check formatting uses: actions-rs/cargo@v1 with: command: fmt args: -- --check - - name: Check benchmark formatting - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --manifest-path benchmarks/Cargo.toml -- --check - - name: Test uses: actions-rs/cargo@v1 with: @@ -103,8 +79,7 @@ jobs: - name: Test benchmarks uses: actions-rs/cargo@v1 with: - command: test - args: --manifest-path benchmarks/Cargo.toml --benches + command: bench - name: SIMD test if: matrix.rust == 'nightly' @@ -119,5 +94,5 @@ jobs: uses: actions-rs/cargo@v1 with: toolchain: nightly - command: test - args: --manifest-path benchmarks/Cargo.toml --features "simd" --benches + command: bench + args: --features "simd" diff --git a/Cargo.toml b/Cargo.toml index 4baaa797..945fa1c2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,35 +1,22 @@ -[package] -name = "roaring" -version = "0.10.6" -rust-version = "1.65.0" -authors = ["Wim Looman ", "Kerollmops "] -description = "A better compressed bitset - pure Rust implementation" +[workspace] +members = ["roaring", "benchmarks"] +resolver = "2" -documentation = "https://docs.rs/roaring" -repository = "https://github.com/RoaringBitmap/roaring-rs" +[workspace.dependencies] +roaring = { path = "roaring" } -readme = "README.md" -keywords = ["roaring", "data-structure", "bitmap"] -categories = ["data-structures"] -edition = "2021" - -license = "MIT OR Apache-2.0" - -[dependencies] -bytemuck = { version = "1.16.1", optional = true } -byteorder = { version = "1.5.0", optional = true } -serde = { version = "1.0.203", optional = true } - -[features] -default = ["std"] -serde = ["dep:serde", "std"] -simd = [] -std = ["dep:bytemuck", "dep:byteorder"] - -[dev-dependencies] +bincode = "1.3.3" +bytemuck = "1.16.1" +byteorder = "1.5.0" +criterion = "0.3" +git2 = { version = "0.19", default-features = false } +indicatif = "0.17" +itertools = "0.13" +once_cell = "1.9" proptest = "1.5.0" +serde = "1.0.203" serde_json = "1.0.120" -bincode = "1.3.3" +zip = { version = "0.6", default-features = false } [profile.test] opt-level = 2 diff --git a/README.md b/README.md index 2d0c259a..132733ac 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,6 @@ This project uses [Clippy][], [rustfmt][], and denies warnings in CI builds. Ava To ensure your changes will be accepted please check them with: ``` cargo fmt -- --check -cargo fmt --manifest-path benchmarks/Cargo.toml -- --check cargo clippy --all-targets -- -D warnings ``` @@ -25,10 +24,10 @@ In addition, ensure all tests are passing with `cargo test` ### Benchmarking -It is recommended to run the `cargo bench` command inside of the `benchmarks` directory. -This directory contains a library that is dedicated to benchmarking the Roaring library -by using a set of [real-world datasets][]. It is also advised to run the benchmarks on -a bare-metal machine, running them on the base branch and then on the contribution PR +It is recommended to run the `cargo bench` command. +The [benchmarks directory](./benchmarks) contains a library that is dedicated to benchmarking the +Roaring library by using a set of [real-world datasets][]. It is also advised to run the benchmarks +on a bare-metal machine, running them on the base branch and then on the contribution PR branch to better see the changes. Those benchmarks are designed on top of the Criterion library, diff --git a/benchmarks/Cargo.toml b/benchmarks/Cargo.toml index cdfafeda..282fb593 100644 --- a/benchmarks/Cargo.toml +++ b/benchmarks/Cargo.toml @@ -4,18 +4,19 @@ description = "An external library for benchmarking the roaring crate with real version = "0.1.0" authors = ["Kerollmops "] edition = "2021" +rust-version = "1.65.0" publish = false [dependencies] -roaring = { path = ".." } +roaring = { workspace = true } [dev-dependencies] -once_cell = "1.9" -git2 = { version = "0.17", default-features = false, features = ["https", "vendored-openssl"] } -zip = { version = "0.5", default-features = false, features = ["deflate"] } -indicatif = "0.16" -criterion = { version = "0.3", features = ["html_reports"] } -itertools = "0.10" +criterion = { workspace = true, features = ["html_reports"] } +git2 = { workspace = true, default-features = false, features = ["https", "vendored-openssl"] } +indicatif = { workspace = true } +itertools = { workspace = true } +once_cell = { workspace = true } +zip = { workspace = true, default-features = false, features = ["deflate"] } [features] simd = ["roaring/simd"] diff --git a/benchmarks/benches/datasets.rs b/benchmarks/benches/datasets.rs index afd2288e..bbc12ab6 100644 --- a/benchmarks/benches/datasets.rs +++ b/benchmarks/benches/datasets.rs @@ -81,6 +81,7 @@ fn init_datasets() -> Result> { "{{prefix}}{{msg:.cyan/blue}} [{{bar}}] {{pos}}/{}", progress.total_objects() )) + .expect("template string invalid") .progress_chars("#> "), ) .with_prefix(" ") @@ -168,6 +169,7 @@ fn parse_datasets>(path: P) -> Result, Box "), ) .with_prefix("Parsing") diff --git a/roaring/Cargo.toml b/roaring/Cargo.toml new file mode 100644 index 00000000..3c81d047 --- /dev/null +++ b/roaring/Cargo.toml @@ -0,0 +1,33 @@ +[package] +name = "roaring" +version = "0.10.6" +rust-version = "1.65.0" +authors = ["Wim Looman ", "Kerollmops "] +description = "A better compressed bitset - pure Rust implementation" + +documentation = "https://docs.rs/roaring" +repository = "https://github.com/RoaringBitmap/roaring-rs" + +readme = "../README.md" +keywords = ["roaring", "data-structure", "bitmap"] +categories = ["data-structures"] +edition = "2021" + +license = "MIT OR Apache-2.0" + +[dependencies] +bytemuck = { workspace = true, optional = true } +byteorder = { workspace = true, optional = true } +serde = { workspace = true, optional = true } + +[features] +default = ["std"] +serde = ["dep:serde", "std"] +simd = [] +std = ["dep:bytemuck", "dep:byteorder"] + +[dev-dependencies] +proptest = { workspace = true } +serde_json = { workspace = true } +bincode = { workspace = true } + diff --git a/src/bitmap/arbitrary.rs b/roaring/src/bitmap/arbitrary.rs similarity index 100% rename from src/bitmap/arbitrary.rs rename to roaring/src/bitmap/arbitrary.rs diff --git a/src/bitmap/cmp.rs b/roaring/src/bitmap/cmp.rs similarity index 100% rename from src/bitmap/cmp.rs rename to roaring/src/bitmap/cmp.rs diff --git a/src/bitmap/container.rs b/roaring/src/bitmap/container.rs similarity index 100% rename from src/bitmap/container.rs rename to roaring/src/bitmap/container.rs diff --git a/src/bitmap/fmt.rs b/roaring/src/bitmap/fmt.rs similarity index 100% rename from src/bitmap/fmt.rs rename to roaring/src/bitmap/fmt.rs diff --git a/src/bitmap/inherent.rs b/roaring/src/bitmap/inherent.rs similarity index 100% rename from src/bitmap/inherent.rs rename to roaring/src/bitmap/inherent.rs diff --git a/src/bitmap/iter.rs b/roaring/src/bitmap/iter.rs similarity index 100% rename from src/bitmap/iter.rs rename to roaring/src/bitmap/iter.rs diff --git a/src/bitmap/mod.rs b/roaring/src/bitmap/mod.rs similarity index 100% rename from src/bitmap/mod.rs rename to roaring/src/bitmap/mod.rs diff --git a/src/bitmap/multiops.rs b/roaring/src/bitmap/multiops.rs similarity index 100% rename from src/bitmap/multiops.rs rename to roaring/src/bitmap/multiops.rs diff --git a/src/bitmap/ops.rs b/roaring/src/bitmap/ops.rs similarity index 100% rename from src/bitmap/ops.rs rename to roaring/src/bitmap/ops.rs diff --git a/src/bitmap/ops_with_serialized.rs b/roaring/src/bitmap/ops_with_serialized.rs similarity index 100% rename from src/bitmap/ops_with_serialized.rs rename to roaring/src/bitmap/ops_with_serialized.rs diff --git a/src/bitmap/proptests.rs b/roaring/src/bitmap/proptests.rs similarity index 100% rename from src/bitmap/proptests.rs rename to roaring/src/bitmap/proptests.rs diff --git a/src/bitmap/serde.rs b/roaring/src/bitmap/serde.rs similarity index 100% rename from src/bitmap/serde.rs rename to roaring/src/bitmap/serde.rs diff --git a/src/bitmap/serialization.rs b/roaring/src/bitmap/serialization.rs similarity index 100% rename from src/bitmap/serialization.rs rename to roaring/src/bitmap/serialization.rs diff --git a/src/bitmap/store/array_store/mod.rs b/roaring/src/bitmap/store/array_store/mod.rs similarity index 100% rename from src/bitmap/store/array_store/mod.rs rename to roaring/src/bitmap/store/array_store/mod.rs diff --git a/src/bitmap/store/array_store/scalar.rs b/roaring/src/bitmap/store/array_store/scalar.rs similarity index 100% rename from src/bitmap/store/array_store/scalar.rs rename to roaring/src/bitmap/store/array_store/scalar.rs diff --git a/src/bitmap/store/array_store/vector.rs b/roaring/src/bitmap/store/array_store/vector.rs similarity index 100% rename from src/bitmap/store/array_store/vector.rs rename to roaring/src/bitmap/store/array_store/vector.rs diff --git a/src/bitmap/store/array_store/visitor.rs b/roaring/src/bitmap/store/array_store/visitor.rs similarity index 100% rename from src/bitmap/store/array_store/visitor.rs rename to roaring/src/bitmap/store/array_store/visitor.rs diff --git a/src/bitmap/store/bitmap_store.rs b/roaring/src/bitmap/store/bitmap_store.rs similarity index 100% rename from src/bitmap/store/bitmap_store.rs rename to roaring/src/bitmap/store/bitmap_store.rs diff --git a/src/bitmap/store/mod.rs b/roaring/src/bitmap/store/mod.rs similarity index 100% rename from src/bitmap/store/mod.rs rename to roaring/src/bitmap/store/mod.rs diff --git a/src/bitmap/util.rs b/roaring/src/bitmap/util.rs similarity index 100% rename from src/bitmap/util.rs rename to roaring/src/bitmap/util.rs diff --git a/src/lib.rs b/roaring/src/lib.rs similarity index 100% rename from src/lib.rs rename to roaring/src/lib.rs diff --git a/src/treemap/arbitrary.rs b/roaring/src/treemap/arbitrary.rs similarity index 100% rename from src/treemap/arbitrary.rs rename to roaring/src/treemap/arbitrary.rs diff --git a/src/treemap/cmp.rs b/roaring/src/treemap/cmp.rs similarity index 100% rename from src/treemap/cmp.rs rename to roaring/src/treemap/cmp.rs diff --git a/src/treemap/fmt.rs b/roaring/src/treemap/fmt.rs similarity index 100% rename from src/treemap/fmt.rs rename to roaring/src/treemap/fmt.rs diff --git a/src/treemap/inherent.rs b/roaring/src/treemap/inherent.rs similarity index 100% rename from src/treemap/inherent.rs rename to roaring/src/treemap/inherent.rs diff --git a/src/treemap/iter.rs b/roaring/src/treemap/iter.rs similarity index 100% rename from src/treemap/iter.rs rename to roaring/src/treemap/iter.rs diff --git a/src/treemap/mod.rs b/roaring/src/treemap/mod.rs similarity index 100% rename from src/treemap/mod.rs rename to roaring/src/treemap/mod.rs diff --git a/src/treemap/multiops.rs b/roaring/src/treemap/multiops.rs similarity index 100% rename from src/treemap/multiops.rs rename to roaring/src/treemap/multiops.rs diff --git a/src/treemap/ops.rs b/roaring/src/treemap/ops.rs similarity index 100% rename from src/treemap/ops.rs rename to roaring/src/treemap/ops.rs diff --git a/src/treemap/serde.rs b/roaring/src/treemap/serde.rs similarity index 100% rename from src/treemap/serde.rs rename to roaring/src/treemap/serde.rs diff --git a/src/treemap/serialization.rs b/roaring/src/treemap/serialization.rs similarity index 100% rename from src/treemap/serialization.rs rename to roaring/src/treemap/serialization.rs diff --git a/src/treemap/util.rs b/roaring/src/treemap/util.rs similarity index 100% rename from src/treemap/util.rs rename to roaring/src/treemap/util.rs diff --git a/tests/bitmapwithoutruns.bin b/roaring/tests/bitmapwithoutruns.bin similarity index 100% rename from tests/bitmapwithoutruns.bin rename to roaring/tests/bitmapwithoutruns.bin diff --git a/tests/bitmapwithruns.bin b/roaring/tests/bitmapwithruns.bin similarity index 100% rename from tests/bitmapwithruns.bin rename to roaring/tests/bitmapwithruns.bin diff --git a/tests/clone.rs b/roaring/tests/clone.rs similarity index 100% rename from tests/clone.rs rename to roaring/tests/clone.rs diff --git a/tests/difference_with.rs b/roaring/tests/difference_with.rs similarity index 100% rename from tests/difference_with.rs rename to roaring/tests/difference_with.rs diff --git a/tests/intersect_with.rs b/roaring/tests/intersect_with.rs similarity index 100% rename from tests/intersect_with.rs rename to roaring/tests/intersect_with.rs diff --git a/tests/is_disjoint.rs b/roaring/tests/is_disjoint.rs similarity index 100% rename from tests/is_disjoint.rs rename to roaring/tests/is_disjoint.rs diff --git a/tests/is_subset.rs b/roaring/tests/is_subset.rs similarity index 100% rename from tests/is_subset.rs rename to roaring/tests/is_subset.rs diff --git a/tests/iter.rs b/roaring/tests/iter.rs similarity index 100% rename from tests/iter.rs rename to roaring/tests/iter.rs diff --git a/tests/lib.rs b/roaring/tests/lib.rs similarity index 100% rename from tests/lib.rs rename to roaring/tests/lib.rs diff --git a/tests/ops.rs b/roaring/tests/ops.rs similarity index 100% rename from tests/ops.rs rename to roaring/tests/ops.rs diff --git a/tests/push.rs b/roaring/tests/push.rs similarity index 100% rename from tests/push.rs rename to roaring/tests/push.rs diff --git a/tests/range_checks.rs b/roaring/tests/range_checks.rs similarity index 100% rename from tests/range_checks.rs rename to roaring/tests/range_checks.rs diff --git a/tests/rank.rs b/roaring/tests/rank.rs similarity index 100% rename from tests/rank.rs rename to roaring/tests/rank.rs diff --git a/tests/select.rs b/roaring/tests/select.rs similarity index 100% rename from tests/select.rs rename to roaring/tests/select.rs diff --git a/tests/serialization.rs b/roaring/tests/serialization.rs similarity index 100% rename from tests/serialization.rs rename to roaring/tests/serialization.rs diff --git a/tests/size_hint.rs b/roaring/tests/size_hint.rs similarity index 100% rename from tests/size_hint.rs rename to roaring/tests/size_hint.rs diff --git a/tests/symmetric_difference_with.rs b/roaring/tests/symmetric_difference_with.rs similarity index 100% rename from tests/symmetric_difference_with.rs rename to roaring/tests/symmetric_difference_with.rs diff --git a/tests/treemap_clone.rs b/roaring/tests/treemap_clone.rs similarity index 100% rename from tests/treemap_clone.rs rename to roaring/tests/treemap_clone.rs diff --git a/tests/treemap_difference_with.rs b/roaring/tests/treemap_difference_with.rs similarity index 100% rename from tests/treemap_difference_with.rs rename to roaring/tests/treemap_difference_with.rs diff --git a/tests/treemap_intersect_with.rs b/roaring/tests/treemap_intersect_with.rs similarity index 100% rename from tests/treemap_intersect_with.rs rename to roaring/tests/treemap_intersect_with.rs diff --git a/tests/treemap_is_disjoint.rs b/roaring/tests/treemap_is_disjoint.rs similarity index 100% rename from tests/treemap_is_disjoint.rs rename to roaring/tests/treemap_is_disjoint.rs diff --git a/tests/treemap_is_subset.rs b/roaring/tests/treemap_is_subset.rs similarity index 100% rename from tests/treemap_is_subset.rs rename to roaring/tests/treemap_is_subset.rs diff --git a/tests/treemap_iter.rs b/roaring/tests/treemap_iter.rs similarity index 100% rename from tests/treemap_iter.rs rename to roaring/tests/treemap_iter.rs diff --git a/tests/treemap_lib.rs b/roaring/tests/treemap_lib.rs similarity index 100% rename from tests/treemap_lib.rs rename to roaring/tests/treemap_lib.rs diff --git a/tests/treemap_ops.rs b/roaring/tests/treemap_ops.rs similarity index 100% rename from tests/treemap_ops.rs rename to roaring/tests/treemap_ops.rs diff --git a/tests/treemap_rank.rs b/roaring/tests/treemap_rank.rs similarity index 100% rename from tests/treemap_rank.rs rename to roaring/tests/treemap_rank.rs diff --git a/tests/treemap_select.rs b/roaring/tests/treemap_select.rs similarity index 100% rename from tests/treemap_select.rs rename to roaring/tests/treemap_select.rs diff --git a/tests/treemap_serialization.rs b/roaring/tests/treemap_serialization.rs similarity index 100% rename from tests/treemap_serialization.rs rename to roaring/tests/treemap_serialization.rs diff --git a/tests/treemap_size_hint.rs b/roaring/tests/treemap_size_hint.rs similarity index 100% rename from tests/treemap_size_hint.rs rename to roaring/tests/treemap_size_hint.rs diff --git a/tests/treemap_symmetric_difference_with.rs b/roaring/tests/treemap_symmetric_difference_with.rs similarity index 100% rename from tests/treemap_symmetric_difference_with.rs rename to roaring/tests/treemap_symmetric_difference_with.rs diff --git a/tests/treemap_union_with.rs b/roaring/tests/treemap_union_with.rs similarity index 100% rename from tests/treemap_union_with.rs rename to roaring/tests/treemap_union_with.rs diff --git a/tests/union_with.rs b/roaring/tests/union_with.rs similarity index 100% rename from tests/union_with.rs rename to roaring/tests/union_with.rs