File tree Expand file tree Collapse file tree 2 files changed +24
-24
lines changed Expand file tree Collapse file tree 2 files changed +24
-24
lines changed Original file line number Diff line number Diff line change @@ -2446,22 +2446,22 @@ main()
2446
2446
2447
2447
``` text
2448
2448
$ kernprof -lv test.py
2449
- Line # Hits Time Per Hit % Time Line Contents
2450
- ==============================================================
2451
- 1 @profile
2452
- 2 def main():
2453
- 3 1 1128.0 1128.0 27.4 a = [*range(10000)]
2454
- 4 1 2994.0 2994.0 72.6 b = {*range(10000)}
2449
+ Line # Hits Time Per Hit % Time Line Contents
2450
+ ========================================================
2451
+ 1 @profile
2452
+ 2 def main():
2453
+ 3 1 1128.0 1128.0 27.4 a = [*range(10000)]
2454
+ 4 1 2994.0 2994.0 72.6 b = {*range(10000)}
2455
2455
```
2456
2456
2457
2457
``` text
2458
2458
$ python3 -m memory_profiler test.py
2459
- Line # Mem usage Increment Line Contents
2460
- ================================================
2461
- 1 35.387 MiB 35.387 MiB @profile
2462
- 2 def main():
2463
- 3 35.734 MiB 0.348 MiB a = [*range(10000)]
2464
- 4 36.160 MiB 0.426 MiB b = {*range(10000)}
2459
+ Line # Mem usage Increment Line Contents
2460
+ ========================================================
2461
+ 1 35.387 MiB 35.387 MiB @profile
2462
+ 2 def main():
2463
+ 3 35.734 MiB 0.348 MiB a = [*range(10000)]
2464
+ 4 36.160 MiB 0.426 MiB b = {*range(10000)}
2465
2465
```
2466
2466
2467
2467
### Call Graph
Original file line number Diff line number Diff line change 2098
2098
</ code > </ pre > </ div >
2099
2099
2100
2100
< pre > < code class ="text language-text "> $ kernprof -lv test.py
2101
- Line # Hits Time Per Hit % Time Line Contents
2102
- ==============================================================
2103
- 1 @profile
2104
- 2 def main():
2105
- 3 1 1128.0 1128.0 27.4 a = [*range(10000)]
2106
- 4 1 2994.0 2994.0 72.6 b = {*range(10000)}
2101
+ Line # Hits Time Per Hit % Time Line Contents
2102
+ ========================================================
2103
+ 1 @profile
2104
+ 2 def main():
2105
+ 3 1 1128.0 1128.0 27.4 a = [*range(10000)]
2106
+ 4 1 2994.0 2994.0 72.6 b = {*range(10000)}
2107
2107
</ code > </ pre >
2108
2108
< pre > < code class ="text language-text "> $ python3 -m memory_profiler test.py
2109
- Line # Mem usage Increment Line Contents
2110
- ================================================
2111
- 1 35.387 MiB 35.387 MiB @profile
2112
- 2 def main():
2113
- 3 35.734 MiB 0.348 MiB a = [*range(10000)]
2114
- 4 36.160 MiB 0.426 MiB b = {*range(10000)}
2109
+ Line # Mem usage Increment Line Contents
2110
+ ========================================================
2111
+ 1 35.387 MiB 35.387 MiB @profile
2112
+ 2 def main():
2113
+ 3 35.734 MiB 0.348 MiB a = [*range(10000)]
2114
+ 4 36.160 MiB 0.426 MiB b = {*range(10000)}
2115
2115
</ code > </ pre >
2116
2116
< div > < h3 id ="callgraph "> Call Graph</ h3 > < div > < h4 id ="generatesapngimageofacallgraphwithhighlightedbottlenecks "> Generates a PNG image of a call graph with highlighted bottlenecks:</ h4 > < pre > < code class ="python language-python hljs "> < span class ="hljs-comment "> # $ pip3 install pycallgraph</ span >
2117
2117
< span class ="hljs-keyword "> from</ span > pycallgraph < span class ="hljs-keyword "> import</ span > output, PyCallGraph
You can’t perform that action at this time.
0 commit comments