Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for column-major grid order #34

Merged
merged 4 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions benches/benches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fn criterion_benchmark(c: &mut Criterion) {
let grid = init_grid();
b.iter_batched(
|| (rand(), rand()),
|(x, y)| grid[x][y],
|(x, y)| grid[(x, y)],
Shir0kamii marked this conversation as resolved.
Show resolved Hide resolved
criterion::BatchSize::SmallInput,
)
});
Expand Down Expand Up @@ -117,7 +117,7 @@ fn criterion_benchmark(c: &mut Criterion) {
let mut g = init_grid();
b.iter_batched(
|| (rand(), rand()),
|(x, y)| g[x][y] = 42,
|(x, y)| g[(x, y)] = 42,
criterion::BatchSize::SmallInput,
)
});
Expand Down Expand Up @@ -181,23 +181,23 @@ fn criterion_benchmark(c: &mut Criterion) {
let grid = init_grid();
b.iter_batched(
|| grid.clone(),
|g| g.rotate_left(),
|mut g| g.rotate_left(),
criterion::BatchSize::SmallInput,
)
});
c.bench_function("grid_rotate_right", |b| {
let grid = init_grid();
b.iter_batched(
|| grid.clone(),
|g| g.rotate_right(),
|mut g| g.rotate_right(),
criterion::BatchSize::SmallInput,
)
});
c.bench_function("grid_rotate_half", |b| {
let grid = init_grid();
b.iter_batched(
|| grid.clone(),
|g| g.rotate_half(),
|mut g| g.rotate_half(),
criterion::BatchSize::SmallInput,
)
});
Expand Down
Loading