Skip to content

delta_for: Hoist end() out of the loop check#30864

Merged
StephanDollberg merged 2 commits into
devfrom
stephan/delta-for-noise
Jun 23, 2026
Merged

delta_for: Hoist end() out of the loop check#30864
StephanDollberg merged 2 commits into
devfrom
stephan/delta-for-noise

Conversation

@StephanDollberg

Copy link
Copy Markdown
Member

Avoid rebuilding the default end iterator on every scanned element.

end() didn't get optimized out and it's not entirely free in this
iterator's case. Hoise it out manually.

Possibly this addresses some noise we are seeing.

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v26.1.x
  • v25.3.x
  • v25.2.x

Release Notes

  • none

Avoid rebuilding the default end iterator on every scanned element.

end() didn't get optimized out and it's not entirely free in this
iterator's case. Hoise it out manually.

Possibly this addresses some noise we are seeing.
Amortize start/stop timer overhead for fast find benchmarks.

@WillemKauf WillemKauf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces iterator-related overhead in delta_for searches by caching end() iterators outside tight loops, and updates the associated micro-benchmark to batch find() calls and report operation counts to the perf harness.

Changes:

  • Hoist end()/this->end() out of loop conditions in deltafor_frame::pred_search and both deltafor_column::pred_search implementations.
  • Update delta_for_bench.cc find_test to perform batched find() calls and return the batch size so perf results are normalized per operation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/v/utils/tests/delta_for_bench.cc Batch find() benchmark iterations and return operation count for perf normalization.
src/v/utils/delta_for.h Cache end() iterators to avoid reconstructing them on every loop condition check during scans.

@vbotbuildovich

Copy link
Copy Markdown
Collaborator

CI test results

test results on build#86095
test_status test_class test_method test_arguments test_kind job_url passed reason test_history
FLAKY(PASS) ShadowLinkTopicFailoverTests test_producer_ids_failover {"storage_mode": "tiered_cloud"} integration https://buildkite.com/redpanda/redpanda/builds/86095#019eefe5-2c0a-42b0-a344-7a9ae5f117e5 10/11 Test PASSES after retries.No significant increase in flaky rate(baseline=0.0032, p0=1.0000, reject_threshold=0.0100. adj_baseline=0.1000, p1=0.3487, trust_threshold=0.5000) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=ShadowLinkTopicFailoverTests&test_method=test_producer_ids_failover
FLAKY(PASS) ShadowLinkingReplicationTests test_replication_with_failures {"storage_mode": "tiered_cloud"} integration https://buildkite.com/redpanda/redpanda/builds/86095#019eefe5-2c0a-4476-a155-eca34cd5541b 10/11 Test PASSES after retries.No significant increase in flaky rate(baseline=0.0023, p0=1.0000, reject_threshold=0.0100. adj_baseline=0.1000, p1=0.3487, trust_threshold=0.5000) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=ShadowLinkingReplicationTests&test_method=test_replication_with_failures
FLAKY(PASS) NodeWiseRecoveryTest test_recovery_local_data_missing {"wait_for_final_manifest_uploads": true} integration https://buildkite.com/redpanda/redpanda/builds/86095#019eefe5-2c09-4b8f-bd91-198e895ac204 9/11 Test PASSES after retries.No significant increase in flaky rate(baseline=0.0645, p0=0.4867, reject_threshold=0.0100. adj_baseline=0.1813, p1=0.4348, trust_threshold=0.5000) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=NodeWiseRecoveryTest&test_method=test_recovery_local_data_missing
FLAKY(PASS) ShadowLinkingRandomOpsTest test_node_operations {"failures": true, "workload_set": "cloud_combos"} integration https://buildkite.com/redpanda/redpanda/builds/86095#019eefe5-2c08-4801-9f0a-51114761ab69 10/11 Test PASSES after retries.No significant increase in flaky rate(baseline=0.0188, p0=1.0000, reject_threshold=0.0100. adj_baseline=0.1000, p1=0.3487, trust_threshold=0.5000) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=ShadowLinkingRandomOpsTest&test_method=test_node_operations

@StephanDollberg StephanDollberg merged commit 93753d9 into dev Jun 23, 2026
19 checks passed
@StephanDollberg StephanDollberg deleted the stephan/delta-for-noise branch June 23, 2026 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants