langgraph: allow tools to return Command in tool node #1168
Annotations
1 warning and 2 notices
benchmark
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|
Benchmark results:
libs/langgraph/langgraph/prebuilt/tool_node.py#L1
.........................................
fanout_to_subgraph_10x: Mean +- std dev: 60.4 ms +- 2.1 ms
.........................................
fanout_to_subgraph_10x_sync: Mean +- std dev: 51.2 ms +- 0.9 ms
.........................................
fanout_to_subgraph_10x_checkpoint: Mean +- std dev: 92.5 ms +- 8.5 ms
.........................................
fanout_to_subgraph_10x_checkpoint_sync: Mean +- std dev: 93.8 ms +- 1.7 ms
.........................................
fanout_to_subgraph_100x: Mean +- std dev: 592 ms +- 25 ms
.........................................
fanout_to_subgraph_100x_sync: Mean +- std dev: 497 ms +- 4 ms
.........................................
fanout_to_subgraph_100x_checkpoint: Mean +- std dev: 936 ms +- 44 ms
.........................................
fanout_to_subgraph_100x_checkpoint_sync: Mean +- std dev: 922 ms +- 17 ms
.........................................
react_agent_10x: Mean +- std dev: 30.8 ms +- 0.6 ms
.........................................
react_agent_10x_sync: Mean +- std dev: 22.4 ms +- 0.2 ms
.........................................
react_agent_10x_checkpoint: Mean +- std dev: 46.7 ms +- 0.7 ms
.........................................
react_agent_10x_checkpoint_sync: Mean +- std dev: 38.1 ms +- 3.0 ms
.........................................
react_agent_100x: Mean +- std dev: 341 ms +- 5 ms
.........................................
react_agent_100x_sync: Mean +- std dev: 271 ms +- 3 ms
.........................................
react_agent_100x_checkpoint: Mean +- std dev: 931 ms +- 10 ms
.........................................
react_agent_100x_checkpoint_sync: Mean +- std dev: 831 ms +- 7 ms
.........................................
wide_state_25x300: Mean +- std dev: 23.2 ms +- 0.5 ms
.........................................
WARNING: the benchmark result may be unstable
* the standard deviation (1.73 ms) is 11% of the mean (15.6 ms)
Try to rerun the benchmark with more runs, values and/or loops.
Run 'python -m pyperf system tune' command to reduce the system jitter.
Use pyperf stats, pyperf dump and pyperf hist to analyze results.
Use --quiet option to hide these warnings.
wide_state_25x300_sync: Mean +- std dev: 15.6 ms +- 1.7 ms
.........................................
wide_state_25x300_checkpoint: Mean +- std dev: 290 ms +- 15 ms
.........................................
wide_state_25x300_checkpoint_sync: Mean +- std dev: 277 ms +- 14 ms
.........................................
wide_state_15x600: Mean +- std dev: 27.1 ms +- 0.5 ms
.........................................
wide_state_15x600_sync: Mean +- std dev: 16.5 ms +- 0.1 ms
.........................................
wide_state_15x600_checkpoint: Mean +- std dev: 494 ms +- 17 ms
.........................................
wide_state_15x600_checkpoint_sync: Mean +- std dev: 479 ms +- 15 ms
.........................................
wide_state_9x1200: Mean +- std dev: 27.0 ms +- 0.6 ms
.........................................
wide_state_9x1200_sync: Mean +- std dev: 16.6 ms +- 0.1 ms
.........................................
wide_state_9x1200_checkpoint: Mean +- std dev: 324 ms +- 15 ms
.........................................
wide_state_9x1200_checkpoint_sync: Mean +- std dev: 309 ms +- 14 ms
|
Comparison against main:
libs/langgraph/langgraph/prebuilt/tool_node.py#L1
+-----------------------------------+---------+-----------------------+
| Benchmark | main | changes |
+===================================+=========+=======================+
| fanout_to_subgraph_100x | 614 ms | 592 ms: 1.04x faster |
+-----------------------------------+---------+-----------------------+
| react_agent_10x_checkpoint_sync | 39.0 ms | 38.1 ms: 1.02x faster |
+-----------------------------------+---------+-----------------------+
| react_agent_100x_checkpoint_sync | 843 ms | 831 ms: 1.01x faster |
+-----------------------------------+---------+-----------------------+
| react_agent_10x | 31.0 ms | 30.8 ms: 1.01x faster |
+-----------------------------------+---------+-----------------------+
| react_agent_100x_checkpoint | 936 ms | 931 ms: 1.00x faster |
+-----------------------------------+---------+-----------------------+
| fanout_to_subgraph_100x_sync | 494 ms | 497 ms: 1.01x slower |
+-----------------------------------+---------+-----------------------+
| fanout_to_subgraph_10x_sync | 50.8 ms | 51.2 ms: 1.01x slower |
+-----------------------------------+---------+-----------------------+
| fanout_to_subgraph_10x | 59.9 ms | 60.4 ms: 1.01x slower |
+-----------------------------------+---------+-----------------------+
| wide_state_9x1200_checkpoint_sync | 305 ms | 309 ms: 1.01x slower |
+-----------------------------------+---------+-----------------------+
| wide_state_15x600_checkpoint | 489 ms | 494 ms: 1.01x slower |
+-----------------------------------+---------+-----------------------+
| wide_state_9x1200_checkpoint | 320 ms | 324 ms: 1.01x slower |
+-----------------------------------+---------+-----------------------+
| wide_state_15x600_checkpoint_sync | 472 ms | 479 ms: 1.01x slower |
+-----------------------------------+---------+-----------------------+
| Geometric mean | (ref) | 1.00x slower |
+-----------------------------------+---------+-----------------------+
Benchmark hidden because not significant (16): fanout_to_subgraph_100x_checkpoint, react_agent_100x, wide_state_15x600_sync, wide_state_25x300, react_agent_10x_sync, fanout_to_subgraph_100x_checkpoint_sync, fanout_to_subgraph_10x_checkpoint_sync, wide_state_15x600, wide_state_9x1200, react_agent_100x_sync, react_agent_10x_checkpoint, wide_state_9x1200_sync, fanout_to_subgraph_10x_checkpoint, wide_state_25x300_sync, wide_state_25x300_checkpoint_sync, wide_state_25x300_checkpoint
|