-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add crate feature "nightly" to enable features in rust nightly
- enables code using cow_is_borrowed - enables code using new_uninit - use Vec::chunk_by (stable since rust 1.70) - use divan for benchmarks - add function to create empty vec
- Loading branch information
1 parent
6a28be8
commit 8bc384e
Showing
23 changed files
with
398 additions
and
266 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
#![feature(test)] | ||
extern crate test; | ||
use test::Bencher; | ||
use divan::Bencher; | ||
|
||
use hidefix::idx::DatasetD; | ||
use hidefix::idx::Index; | ||
|
||
#[bench] | ||
fn slicer(b: &mut Bencher) { | ||
#[divan::bench] | ||
fn slicer(b: Bencher) { | ||
let i = Index::index("tests/data/coads_climatology.nc4").unwrap(); | ||
let d = i.dataset("SST").unwrap(); | ||
if let DatasetD::D3(d) = d { | ||
b.iter(|| d.chunk_slices(..).for_each(drop)) | ||
b.bench_local(|| d.chunk_slices(..).for_each(drop)) | ||
} else { | ||
panic!() | ||
} | ||
} | ||
|
||
fn main() { | ||
divan::main(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
#![feature(test)] | ||
extern crate test; | ||
use test::Bencher; | ||
use divan::Bencher; | ||
|
||
use hidefix::idx::Index; | ||
|
||
#[bench] | ||
fn chunked_1d(b: &mut Bencher) { | ||
b.iter(|| Index::index("tests/data/dmrpp/chunked_oneD.h5").unwrap()) | ||
#[divan::bench] | ||
fn chunked_1d(b: Bencher) { | ||
b.bench_local(|| Index::index("tests/data/dmrpp/chunked_oneD.h5").unwrap()) | ||
} | ||
|
||
fn main() { | ||
divan::main(); | ||
} |
Oops, something went wrong.