... | ... | @@ -25,7 +25,9 @@ https://github.com/rkern/line_profiler |
|
|
|
|
|
## Profiling memory
|
|
|
|
|
|
Use [memory_profiler](https://github.com/pythonprofilers/memory_profiler)
|
|
|
### With [memory_profiler](https://github.com/pythonprofilers/memory_profiler)
|
|
|
|
|
|
#### Global memory usage
|
|
|
|
|
|
Note: use the `--python python3` option as indicated in [this issue](https://github.com/pythonprofilers/memory_profiler/issues/144).
|
|
|
|
... | ... | @@ -36,6 +38,14 @@ mprof plot |
|
|
|
|
|
Optionally decorate some functions with `@profile`, without importing the decorator, as explained in the [README](https://github.com/pythonprofilers/memory_profiler). You'll see the memory usage of those functions explicitly on the chart.
|
|
|
|
|
|
#### Line by line
|
|
|
|
|
|
Decorate the functions you want to profile with `@profile` and run with:
|
|
|
|
|
|
```sh
|
|
|
python -m memory_profiler convert.py source-data json-data
|
|
|
```
|
|
|
|
|
|
## Misc
|
|
|
|
|
|
- https://github.com/nvdv/vprof |
|
|
\ No newline at end of file |