You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/cli.md
+143Lines changed: 143 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -120,6 +120,7 @@ python -m ngraph run <scenario_file> [options]
120
120
-`--results`, `-r`: Optional path to export results as JSON. If provided without a path, defaults to "results.json"
121
121
-`--stdout`: Print results to stdout
122
122
-`--keys`, `-k`: Space-separated list of workflow step names to include in output
123
+
-`--profile`: Enable performance profiling with CPU analysis and bottleneck detection
123
124
-`--help`, `-h`: Show help message
124
125
125
126
## Examples
@@ -179,6 +180,148 @@ workflow:
179
180
180
181
Then `--keys build_graph` will include only the results from the BuildGraph step, and `--keys capacity_probe` will include only the CapacityProbe results.
181
182
183
+
### Performance Profiling
184
+
185
+
NetGraph provides performance profiling to identify bottlenecks, analyze execution time, and optimize workflow performance. The profiling system provides CPU-level analysis with function-by-function timing and bottleneck detection.
186
+
187
+
#### Performance Analysis
188
+
189
+
Use `--profile` to get performance analysis:
190
+
191
+
```bash
192
+
# Run scenario with profiling
193
+
python -m ngraph run scenario.yaml --profile
194
+
195
+
# Combine profiling with results export
196
+
python -m ngraph run scenario.yaml --profile --results
197
+
198
+
# Profiling with filtered output
199
+
python -m ngraph run scenario.yaml --profile --keys capacity_probe
200
+
```
201
+
202
+
Performance profiling provides:
203
+
204
+
-**Summary**: Total execution time, CPU efficiency, function call statistics
205
+
-**Step timing analysis**: Time spent in each workflow step with percentage breakdown
206
+
-**Bottleneck identification**: Workflow steps consuming >10% of total execution time
207
+
-**Function-level analysis**: Top CPU-consuming functions within each bottleneck
208
+
-**Call statistics**: Function call counts and timing distribution
209
+
-**CPU utilization patterns**: Detailed breakdown of computational efficiency
210
+
-**Targeted recommendations**: Specific optimization suggestions for each bottleneck
211
+
212
+
#### Profiling Output
213
+
214
+
Profiling generates a performance report displayed after scenario execution:
0 commit comments