-
-
Notifications
You must be signed in to change notification settings - Fork 104
Open
Description
Profiling shows that signature_adapter (dispatcher.py:203) accounts for
~30–50% of callback execution time in steady-state transitions.
The overhead comes from repeated use of inspect.signature and argument
binding on every callback invocation.
Each transition re-binds callback arguments dynamically, dominating CPU time
in high-frequency state machines.
Evidence
Flamegraph shows signature_adapter → inspect.signature → bind
as a wide frame in callback execution.
Suggested improvements
- Cache bound callback adapters at state-machine construction time
- Optionally allow users to disable signature binding entirely
- Document performance impact of flexible callback signatures
Impact
This significantly limits throughput for systems with frequent transitions
and makes the library unsuitable for performance-critical workflows.
Metadata
Metadata
Assignees
Labels
No labels