Skip to content

Commit

Permalink
Change ~some~ all things
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrobbel committed Jul 21, 2023
1 parent 65f518a commit 952ccf0
Show file tree
Hide file tree
Showing 31 changed files with 2,305 additions and 1,227 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/target
Cargo.lock

.vscode
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ keywords.workspace = true
categories.workspace = true

[features]
default = ["derive"]
default = ["derive", "unsafe"]
derive = ["dep:narrow-derive"]
unsafe = []

Expand Down
10 changes: 5 additions & 5 deletions benches/narrow/bitmap/iter.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use criterion::{BenchmarkId, Criterion, Throughput};
use narrow::bitmap::Bitmap;
use narrow::{bitmap::Bitmap, buffer::BoxBuffer};
use rand::{prelude::SmallRng, Rng, SeedableRng};

pub(super) fn bench(c: &mut Criterion) {
Expand All @@ -16,7 +16,7 @@ pub(super) fn bench(c: &mut Criterion) {
group.bench_with_input(
BenchmarkId::new("narrow", format!("{size}/{null_fraction}")),
&input,
|b, input| b.iter(|| Bitmap::<Vec<u8>>::from_iter(input)),
|b, input| b.iter(|| Bitmap::<BoxBuffer>::from_iter(input)),
);
}
}
Expand All @@ -31,12 +31,12 @@ pub(super) fn bench(c: &mut Criterion) {
let input = (0..size)
.map(|_| rng.gen_bool(1. - null_fraction))
.collect::<Vec<_>>();
let narrow_bitmap = Bitmap::<Vec<u8>>::from_iter(&input);
let narrow_bitmap = Bitmap::<BoxBuffer>::from_iter(&input);
group.throughput(Throughput::Elements(size as u64));
group.bench_with_input(
BenchmarkId::new("narrow", format!("{size}/{null_fraction}")),
&narrow_bitmap,
|b, input| b.iter(|| Vec::<bool>::from_iter(input)),
&(),
|b, _| b.iter(|| Vec::<bool>::from_iter(&narrow_bitmap)),
);
}
}
Expand Down
12 changes: 6 additions & 6 deletions narrow-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ categories.workspace = true
proc-macro = true

[dependencies]
once_cell = "1"
proc-macro-crate = "1"
proc-macro2 = "1"
quote = "1"
syn = { version = "2", features = ["extra-traits", "visit", "visit-mut"] }
once_cell = "1.18.0"
proc-macro-crate = "1.3.1"
proc-macro2 = "1.0.66"
quote = "1.0.31"
syn = { version = "2.0.26", features = ["extra-traits", "visit", "visit-mut"] }

[dev-dependencies]
macrotest = "1"
macrotest = "1.0.9"
2 changes: 1 addition & 1 deletion narrow-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mod r#struct;
mod union;
mod util;

static CRATE: &str = "narrow";
const CRATE: &str = "narrow";

static NARROW: Lazy<String> = Lazy::new(|| match proc_macro_crate::crate_name(CRATE) {
Ok(found) => match found {
Expand Down
Loading

0 comments on commit 952ccf0

Please sign in to comment.