Skip to content

Conversation

@caicancai
Copy link
Contributor

Handle cancelled reads earlier in on_event (Request/Polled) and keep requests_by_offset in sync when cancellation is detected before poll promotion.

Purpose
When read futures are dropped quickly around registration/poll transition, cancelled requests no longer linger in internal state. This reduces stale index entries, avoids repeated coalescing scans over requests that will never run, and keeps queue/index state more consistent without changing existing dequeue/coalescing correctness checks.

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 10, 2026

CodSpeed Performance Report

Merging this PR will improve performance by 34.26%

Comparing caicancai:fix/read-early-cancel-cleanup (57159f2) with develop (d1097c5)

Summary

⚡ 1 improved benchmark
✅ 1137 untouched benchmarks
⏩ 1265 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation chunked_bool_into_canonical[(1000, 10)] 88.4 µs 65.9 µs +34.26%

Footnotes

  1. 1265 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@joseph-isaacs joseph-isaacs added the action/benchmark Trigger full benchmarks to run on this PR label Feb 10, 2026
@robert3005 robert3005 added the changelog/performance A performance improvement label Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action/benchmark Trigger full benchmarks to run on this PR changelog/performance A performance improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants