Skip to content

Commit

Permalink
clippy: manual_div_ceil (#4438)
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo authored Jan 13, 2025
1 parent 73080ab commit 91210fc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/benches/shredder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ fn make_shreds(num_shreds: usize) -> Vec<Shred> {
fn bench_shredder_ticks(bencher: &mut Bencher) {
let kp = Keypair::new();
let shred_size = LEGACY_SHRED_DATA_CAPACITY;
let num_shreds = ((1000 * 1000) + (shred_size - 1)) / shred_size;
let num_shreds = 1_000_000_usize.div_ceil(shred_size);
// ~1Mb
let num_ticks = max_ticks_per_n_shreds(1, Some(LEGACY_SHRED_DATA_CAPACITY)) * num_shreds as u64;
let entries = create_ticks(num_ticks, 0, Hash::default());
Expand All @@ -83,7 +83,7 @@ fn bench_shredder_ticks(bencher: &mut Bencher) {
fn bench_shredder_large_entries(bencher: &mut Bencher) {
let kp = Keypair::new();
let shred_size = LEGACY_SHRED_DATA_CAPACITY;
let num_shreds = ((1000 * 1000) + (shred_size - 1)) / shred_size;
let num_shreds = 1_000_000_usize.div_ceil(shred_size);
let txs_per_entry = 128;
let num_entries = max_entries_per_n_shred(
&make_test_entry(txs_per_entry),
Expand Down Expand Up @@ -115,7 +115,7 @@ fn bench_deshredder(bencher: &mut Bencher) {
let kp = Keypair::new();
let shred_size = LEGACY_SHRED_DATA_CAPACITY;
// ~10Mb
let num_shreds = ((10000 * 1000) + (shred_size - 1)) / shred_size;
let num_shreds = 10_000_000_usize.div_ceil(shred_size);
let num_ticks = max_ticks_per_n_shreds(1, Some(shred_size)) * num_shreds as u64;
let entries = create_ticks(num_ticks, 0, Hash::default());
let shredder = Shredder::new(1, 0, 0, 0).unwrap();
Expand Down

0 comments on commit 91210fc

Please sign in to comment.