-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Open
Copy link
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Description
Issue Description
Currently in the Runtime._worker method, a new node instance is created for each execution:
node = self._node_mapping[state["node_name"]]
outputs = await node()._execute(node.Inputs(**state["inputs"]))This approach ensures isolation but may impact performance, especially under high throughput scenarios.
Proposed Solution
Consider caching node instances to improve performance:
- Cache instances in a dictionary keyed by node name
- Reuse existing instances if nodes are stateless
- Manage a pool of instances if needed
Implementation Considerations
- Evaluate if nodes are stateless and safe to reuse
- Consider thread/async safety implications
- Measure performance impact before and after changes
References
- Identified in PR Cleaning exospherehost python sdk and adding first exospherehost runtime #141: Cleaning exospherehost python sdk and adding first exospherehost runtime #141
- Original comment: Cleaning exospherehost python sdk and adding first exospherehost runtime #141 (comment)
- File:
python-sdk/exospherehost/runtime.pyaround lines 289-290
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed