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
See [Scalene-Agents.md](Scalene-Agents.md) for detailed information about interpreting Scalene's profiling output, including Python vs C time, memory metrics, and optimization strategies.
% scalene view --html # save to scalene-profile.html
387
+
% scalene view myprofile.json # open specific profile in browser
388
+
389
+
options:
390
+
-h, --help show this help message and exit
391
+
--cli display profile in the terminal
392
+
--html save to scalene-profile.html (no browser)
393
+
-r, --reduced only show lines with activity (--cli mode)
313
394
```
314
395
</details>
315
396
@@ -410,7 +491,11 @@ Can I use Scalene with PyTest?
410
491
411
492
**A:** Yes! You can run it as follows (for example):
412
493
413
-
`python3 -m scalene --- -m pytest your_test.py`
494
+
`scalene run -m pytest your_test.py`
495
+
496
+
or
497
+
498
+
`python3 -m scalene run -m pytest your_test.py`
414
499
415
500
</details>
416
501
@@ -424,15 +509,15 @@ Is there any way to get shorter profiles or do more targeted profiling?
424
509
1. Use `--reduced-profile` to include only lines and files with memory/CPU/GPU activity.
425
510
2. Use `--profile-only` to include only filenames containing specific strings (as in, `--profile-only foo,bar,baz`).
426
511
3. Decorate functions of interest with `@profile` to have Scalene report _only_ those functions.
427
-
4. Turn profiling on and off programmatically by importing Scalene profiler (`from scalene import scalene_profiler`) and then turning profiling on and off via `scalene_profiler.start()` and `scalene_profiler.stop()`. By default, Scalene runs with profiling on, so to delay profiling until desired, use the `--off` command-line option (`python3 -m scalene --off yourprogram.py`).
512
+
4. Turn profiling on and off programmatically by importing Scalene profiler (`from scalene import scalene_profiler`) and then turning profiling on and off via `scalene_profiler.start()` and `scalene_profiler.stop()`. By default, Scalene runs with profiling on, so to delay profiling until desired, use the `--off` command-line option (`scalene run --off yourprogram.py`).
428
513
</details>
429
514
430
515
<details>
431
516
<summary>
432
517
How do I run Scalene in PyCharm?
433
518
</summary>
434
519
435
-
**A:** In PyCharm, you can run Scalene at the command line by opening the terminal at the bottom of the IDE and running a Scalene command (e.g., `python -m scalene <your program>`). Use the options `--cli`, `--html`, and `--outfile <your output.html>` to generate an HTML file that you can then view in the IDE.
520
+
**A:** In PyCharm, you can run Scalene at the command line by opening the terminal at the bottom of the IDE and running a Scalene command (e.g., `scalene run <your program>`). Then use `scalene view --html` to generate an HTML file (`scalene-profile.html`) that you can view in the IDE.
0 commit comments