fix: more cached type hints#6161
Conversation
Greptile SummaryThis PR is a small, focused performance improvement that extends the "cached type hints" pattern to the event-handler processing path in Changes:
Why safe: The change is minimal and well-scoped: it replaces one uncached Confidence Score: 5/5
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Event dispatched to BaseState._process_event] --> B[Build functools.partial fn from handler.fn]
B --> C{types.get_type_hints\nhandler.fn}
C -- Cache hit --> D[Return cached type hints dict]
C -- Cache miss --> E[typing.get_type_hints_og\nevaluates annotations]
E --> F[Store result in lru_cache]
F --> D
D --> G[Iterate payload args]
G --> H{Type hint found\nfor arg?}
H -- No / Any --> I[Skip coercion]
H -- Yes --> J[Coerce value to hinted type]
I --> K[Process next arg]
J --> K
Last reviewed commit: 39da464 |
No description provided.