Browse Source

Profiling

pull/44/head
Jure Šorn 5 years ago
parent
commit
858fcc60dd
2 changed files with 24 additions and 24 deletions
  1. 24
      README.md
  2. 24
      index.html

24
README.md

@ -2446,22 +2446,22 @@ main()
```text
$ kernprof -lv test.py
Line # Hits Time Per Hit % Time Line Contents
==============================================================
1 @profile
2 def main():
3 1 1128.0 1128.0 27.4 a = [*range(10000)]
4 1 2994.0 2994.0 72.6 b = {*range(10000)}
Line # Hits Time Per Hit % Time Line Contents
========================================================
1 @profile
2 def main():
3 1 1128.0 1128.0 27.4 a = [*range(10000)]
4 1 2994.0 2994.0 72.6 b = {*range(10000)}
```
```text
$ python3 -m memory_profiler test.py
Line # Mem usage Increment Line Contents
================================================
1 35.387 MiB 35.387 MiB @profile
2 def main():
3 35.734 MiB 0.348 MiB a = [*range(10000)]
4 36.160 MiB 0.426 MiB b = {*range(10000)}
Line # Mem usage Increment Line Contents
========================================================
1 35.387 MiB 35.387 MiB @profile
2 def main():
3 35.734 MiB 0.348 MiB a = [*range(10000)]
4 36.160 MiB 0.426 MiB b = {*range(10000)}
```
### Call Graph

24
index.html

@ -2098,20 +2098,20 @@ main()
</code></pre></div>
<pre><code class="text language-text">$ kernprof -lv test.py
Line # Hits Time Per Hit % Time Line Contents
==============================================================
1 @profile
2 def main():
3 1 1128.0 1128.0 27.4 a = [*range(10000)]
4 1 2994.0 2994.0 72.6 b = {*range(10000)}
Line # Hits Time Per Hit % Time Line Contents
========================================================
1 @profile
2 def main():
3 1 1128.0 1128.0 27.4 a = [*range(10000)]
4 1 2994.0 2994.0 72.6 b = {*range(10000)}
</code></pre>
<pre><code class="text language-text">$ python3 -m memory_profiler test.py
Line # Mem usage Increment Line Contents
================================================
1 35.387 MiB 35.387 MiB @profile
2 def main():
3 35.734 MiB 0.348 MiB a = [*range(10000)]
4 36.160 MiB 0.426 MiB b = {*range(10000)}
Line # Mem usage Increment Line Contents
========================================================
1 35.387 MiB 35.387 MiB @profile
2 def main():
3 35.734 MiB 0.348 MiB a = [*range(10000)]
4 36.160 MiB 0.426 MiB b = {*range(10000)}
</code></pre>
<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>
<span class="hljs-keyword">from</span> pycallgraph <span class="hljs-keyword">import</span> output, PyCallGraph

Loading…
Cancel
Save