Skip to content

Fast-path CoalescedQEventLoop.call_soon on Python 3.14 and cache MessageRow.header - #2350

Merged
trissim merged 1 commit into
mainfrom
perf/coalesced-loop-call-soon-and-message-header-cache
Nov 28, 2026
Merged

trissim merged 1 commit into
mainfrom
perf/coalesced-loop-call-soon-and-message-header-cache

Conversation

@trissim

@trissim trissim commented Nov 28, 2026

Copy link
Copy Markdown
  1. Overrides call_soon and call_later on CoalescedQEventLoop (src/toad/qt/client_start.py) using inspect.iscoroutinefunction instead of qasync.QEventLoop.call_later's deprecated asyncio.iscoroutinefunction (which fired warnings.warn on every asyncio callback on Python 3.14; unprofiled 10k call_soon drops from 70.42 ms to ~16.5 ms, ~4.3x faster, and eliminates all 18 qasync DeprecationWarnings). 2. Caches MessageRow.header (src/toad/message_rows.py) via @cached_property on the immutable frozen dataclass so route_text / line_blocks / header_blocks build Divider once per row instead of 3-4x. Verified: REL_IMPORTS=0, qt_inherit_ratchet.py 0/0/0/0/0 (Qt-only 47), 59 focused tests passed.

@trissim
trissim merged commit bc8650e into main Nov 28, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant