perf: skip transaction for retry requeue and tune slow benchmarks#79
Merged
Conversation
Add `requeue_for_retry` that executes a bare UPDATE on the pool instead of BEGIN IMMEDIATE + UPDATE + COMMIT. With max_connections(1) this cuts connection hold time by 2/3 for retries, letting dispatch interleave sooner. Measured 2.5x throughput improvement on retryable_dead_letter. Reduce sample_size/warm_up/measurement_time on query_by_tags and retryable_dead_letter benchmark groups to cut wall-clock time ~50%.
Contributor
Benchmark ComparisonClick to expand |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
requeue_for_retrytoTaskStorethat executes a bareUPDATEon the pool instead ofBEGIN IMMEDIATE→UPDATE→COMMIT, cutting connection hold time by 2/3 for the retry path. Withopen_memory()'s single-connection pool, this letspop_next_batchdispatch interleave sooner with concurrent failure writes.handle_failureinto a fast path (requeue_for_retryfor will-retry) and the existing transactionalfail_with_recordfor terminal failures that require multi-statement atomicity (INSERT history + DELETE task).query_by_tagsandretryable_dead_letterbenchmark groups (sample_size(10),warm_up_time(1s),measurement_time(3s)) to reduce wall-clock time ~50%.Benchmark results
retryable_dead_letterthroughput improved ~2.5x across all four backoff strategies: