From 7f434f38aa37e05784dbcbb229dc55e19c111704 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 23 Sep 2026 19:07:50 +0000 Subject: [PATCH] Remove the random-index FSL take benchmarks These took 10 or 100 indices from 500 lists, so the measured region copied a few kilobytes at most and nearly all of its cost was the allocation that the take and canonicalization perform. Each one reported two fixed values about 27 us apart and flipped between them on pull requests that changed no Vortex code, including a documentation-only one. Excluding allocator time from the shard in #9994 settled the dictionary decode and chunked take benchmarks but not these: they kept flipping, and take_fsl_u64_random[64, 10] fell to 0.6 us, the harness floor, which shows how little of it was ever Vortex work. The chunked and forced-strategy benchmarks in the same file still cover the FSL take paths, with deterministic index patterns. Signed-off-by: Claude --- vortex-array/benches/take_fsl.rs | 103 ------------------------------- 1 file changed, 103 deletions(-) diff --git a/vortex-array/benches/take_fsl.rs b/vortex-array/benches/take_fsl.rs index 0d042dcf93a..d6b05f769e6 100644 --- a/vortex-array/benches/take_fsl.rs +++ b/vortex-array/benches/take_fsl.rs @@ -54,15 +54,6 @@ static SESSION: LazyLock = LazyLock::new(array_session); /// Number of lists in the source array. const NUM_LISTS: usize = 500; -/// Number of indices to take. -/// -/// Together with [`LIST_SIZES`] these are sized so the widest type at the largest list size stays -/// under 1ms per iteration under codspeed simulation. -const NUM_INDICES: &[usize] = &[10, 100]; - -/// Fixed size list lengths (elements per list). See [`NUM_INDICES`]. -const LIST_SIZES: &[usize] = &[16, 64, 128, 256]; - /// F16 list lengths for isolating the per-index, piecewise, and manual range-copy strategies. const F16_STRATEGY_LIST_SIZES: &[usize] = &[1, 2, 4, 8, 16, 64, 128, 256, 512, 1024, 2048]; @@ -92,16 +83,6 @@ where FixedSizeListArray::new(elements.into_array(), list_size as u32, validity, num_lists) } -fn create_i64_fsl_with_validity( - list_size: usize, - num_lists: usize, - validity: Validity, -) -> FixedSizeListArray { - let total_elements = list_size * num_lists; - let elements: Buffer = (0..total_elements as i64).collect(); - FixedSizeListArray::new(elements.into_array(), list_size as u32, validity, num_lists) -} - /// Creates random indices for taking from the array. fn create_random_indices(num_indices: usize, max_index: usize) -> Buffer { let mut rng = StdRng::seed_from_u64(42); @@ -215,63 +196,6 @@ fn take_chunked_fsl_sorted(bencher: Bencher, num_indices bench_take_array::(bencher, num_indices, array, true); } -#[divan::bench(args = NUM_INDICES, consts = LIST_SIZES)] -fn take_fsl_random(bencher: Bencher, num_indices: usize) { - let fsl = create_i64_fsl_with_validity(LIST_SIZE, NUM_LISTS, Validity::NonNullable); - bench_take_fsl_random::(bencher, num_indices, fsl); -} - -#[divan::bench(args = NUM_INDICES, consts = LIST_SIZES)] -fn take_fsl_f16_random(bencher: Bencher, num_indices: usize) { - take_fsl_random_typed::(bencher, num_indices); -} - -#[divan::bench(args = NUM_INDICES, consts = LIST_SIZES)] -fn take_fsl_u8_random(bencher: Bencher, num_indices: usize) { - take_fsl_random_typed::(bencher, num_indices); -} - -#[divan::bench(args = NUM_INDICES, consts = LIST_SIZES)] -fn take_fsl_u32_random(bencher: Bencher, num_indices: usize) { - take_fsl_random_typed::(bencher, num_indices); -} - -#[divan::bench(args = NUM_INDICES, consts = LIST_SIZES)] -fn take_fsl_u64_random(bencher: Bencher, num_indices: usize) { - take_fsl_random_typed::(bencher, num_indices); -} - -fn take_fsl_random_typed(bencher: Bencher, num_indices: usize) -where - T: NativePType + FromPrimitive, -{ - let fsl = create_fsl::(LIST_SIZE, NUM_LISTS); - bench_take_fsl_random::(bencher, num_indices, fsl); -} - -fn bench_take_fsl_random( - bencher: Bencher, - num_indices: usize, - fsl: FixedSizeListArray, -) where - T: NativePType, -{ - let indices = create_random_indices(num_indices, NUM_LISTS); - let indices_array = indices.into_array(); - - bencher - .counter(BytesCount::of_many::(num_indices * LIST_SIZE)) - .with_inputs(|| (&fsl, &indices_array, SESSION.create_execution_ctx())) - .bench_refs(|(array, indices, execution_ctx)| { - array - .clone() - .take(indices.clone()) - .unwrap() - .execute::(execution_ctx) - .unwrap() - }); -} - #[divan::bench(args = F16_STRATEGY_NUM_INDICES, consts = F16_STRATEGY_LIST_SIZES)] fn take_fsl_f16_force_per_index(bencher: Bencher, num_indices: usize) { let fsl = create_fsl::(LIST_SIZE, NUM_LISTS); @@ -427,30 +351,3 @@ fn take_fsl_f16_manual_range_copy_strategy( ) } } - -#[divan::bench(args = NUM_INDICES, consts = LIST_SIZES)] -fn take_fsl_nullable_random(bencher: Bencher, num_indices: usize) { - // Create validity with ~10% nulls - let mut rng = StdRng::seed_from_u64(123); - let validity = Validity::from_iter((0..NUM_LISTS).map(|_| rng.random_ratio(9, 10))); - - let fsl = create_i64_fsl_with_validity(LIST_SIZE, NUM_LISTS, validity); - bench_take_fsl_random::(bencher, num_indices, fsl); -} - -#[divan::bench(args = NUM_INDICES, consts = LIST_SIZES)] -fn take_fsl_f16_nullable_random(bencher: Bencher, num_indices: usize) { - take_fsl_nullable_random_typed::(bencher, num_indices); -} - -fn take_fsl_nullable_random_typed(bencher: Bencher, num_indices: usize) -where - T: NativePType + FromPrimitive, -{ - // Create validity with ~10% nulls - let mut rng = StdRng::seed_from_u64(123); - let validity = Validity::from_iter((0..NUM_LISTS).map(|_| rng.random_ratio(9, 10))); - - let fsl = create_fsl_with_validity::(LIST_SIZE, NUM_LISTS, validity); - bench_take_fsl_random::(bencher, num_indices, fsl); -}