Skip to content

Commit 858fcc6

Browse files
committed
Profiling
1 parent 4726291 commit 858fcc6

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2446,22 +2446,22 @@ main()
24462446

24472447
```text
24482448
$ 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)}
24552455
```
24562456

24572457
```text
24582458
$ 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)}
24652465
```
24662466

24672467
### Call Graph

index.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2098,20 +2098,20 @@
20982098
</code></pre></div>
20992099

21002100
<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)}
21072107
</code></pre>
21082108
<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)}
21152115
</code></pre>
21162116
<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>
21172117
<span class="hljs-keyword">from</span> pycallgraph <span class="hljs-keyword">import</span> output, PyCallGraph

0 commit comments

Comments
 (0)