Skip to content

Speed up message handler lookup by deferring the message class list - #86

Merged
trissim merged 2 commits into
mainfrom
perf/message-handler-lookup-20261006
Oct 7, 2026
Merged

trissim merged 2 commits into
mainfrom
perf/message-handler-lookup-20261006

Conversation

@trissim

@trissim trissim commented Oct 7, 2026 •

Copy link
Copy Markdown

MessagePump handler dispatch now builds the list of message base classes only when a class has decorated handlers, and reads each class's __dict__ and the private method name once. A new test in test_on.py replaces a handler by name during decorated dispatch and checks the result. The change in message_pump.py is about 15 lines.

@trissim
trissim marked this pull request as ready for review October 7, 2026 03:21
Copilot AI balanced review requested due to automatic review settings October 7, 2026 03:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@trissim
trissim merged commit 6971980 into main Oct 7, 2026
2 of 22 checks passed
@trissim trissim changed the title Remove repeated work from native handler lookup Speed up message handler lookup by deferring the message class list Oct 11, 2026
@trissim
trissim deleted the perf/message-handler-lookup-20261006 branch October 11, 2026 20:05
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.

2 participants