Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1f577da

Browse files
committed
Profiling
1 parent 696f46a commit 1f577da

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1936,7 +1936,7 @@ with <conn>.begin(): ... # Exits the block with commit or
19361936

19371937
```text
19381938
+------------+--------------+----------+----------------------------------+
1939-
| Dialect | pip3 install | import | Dependencies |
1939+
| Dialect | pip3 install | import | Dependencies |
19401940
+------------+--------------+----------+----------------------------------+
19411941
| mysql | mysqlclient | MySQLdb | www.pypi.org/project/mysqlclient |
19421942
| postgresql | psycopg2 | psycopg2 | www.pypi.org/project/psycopg2 |
@@ -2598,8 +2598,7 @@ duration_in_seconds = perf_counter() - start_time
25982598
### Profiling by Line
25992599
```text
26002600
$ pip3 install line_profiler
2601-
$ echo "
2602-
@profile
2601+
$ echo "@profile
26032602
def main():
26042603
a = list(range(10000))
26052604
b = set(range(10000))
@@ -2615,8 +2614,8 @@ Line # Hits Time Per Hit % Time Line Contents
26152614

26162615
### Call and Flame Graphs
26172616
```text
2618-
$ pip3 install gprof2dot snakeviz
2619-
$ apt/brew install graphviz
2617+
$ pip3 install gprof2dot snakeviz; apt/brew install graphviz
2618+
$ tail -n 4 test.py > test.py
26202619
$ python3 -m cProfile -o test.prof test.py
26212620
$ gprof2dot -f pstats test.prof | dot -Tpng -o test.png; xdg-open/open test.png
26222621
$ snakeviz test.prof

index.html

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
<body>
5656
<header>
57-
<aside>June 30, 2023</aside>
57+
<aside>July 4, 2023</aside>
5858
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
5959
</header>
6060

@@ -1610,7 +1610,7 @@
16101610
</code></pre></div>
16111611

16121612
<pre><code class="text language-text">┏━━━━━━━━━━━━┯━━━━━━━━━━━━━━┯━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
1613-
┃ Dialect │ pip3 install │ import │ Dependencies ┃
1613+
┃ Dialect │ pip3 install │ import │ Dependencies ┃
16141614
┠────────────┼──────────────┼──────────┼──────────────────────────────────┨
16151615
┃ mysql │ mysqlclient │ MySQLdb │ www.pypi.org/project/mysqlclient ┃
16161616
┃ postgresql │ psycopg2 │ psycopg2 │ www.pypi.org/project/psycopg2 ┃
@@ -2129,8 +2129,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
21292129
</code></pre></div>
21302130

21312131
<div><h3 id="profilingbyline">Profiling by Line</h3><pre><code class="text language-text">$ pip3 install line_profiler
2132-
$ echo "
2133-
@profile
2132+
$ echo "@profile
21342133
def main():
21352134
a = list(range(10000))
21362135
b = set(range(10000))
@@ -2144,8 +2143,8 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
21442143
4 1 487.0 487.0 68.9 b = set(range(10000))
21452144
</code></pre></div>
21462145

2147-
<div><h3 id="callandflamegraphs">Call and Flame Graphs</h3><pre><code class="text language-text">$ pip3 install gprof2dot snakeviz
2148-
$ apt/brew install graphviz
2146+
<div><h3 id="callandflamegraphs">Call and Flame Graphs</h3><pre><code class="text language-text">$ pip3 install gprof2dot snakeviz; apt/brew install graphviz
2147+
$ tail -n 4 test.py &gt; test.py
21492148
$ python3 -m cProfile -o test.prof test.py
21502149
$ gprof2dot -f pstats test.prof | dot -Tpng -o test.png; xdg-open/open test.png
21512150
$ snakeviz test.prof
@@ -2933,7 +2932,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
29332932

29342933

29352934
<footer>
2936-
<aside>June 30, 2023</aside>
2935+
<aside>July 4, 2023</aside>
29372936
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
29382937
</footer>
29392938

parse.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,12 +461,12 @@ const DIAGRAM_9_B =
461461

462462
const DIAGRAM_95_A =
463463
'+------------+--------------+----------+----------------------------------+\n' +
464-
'| Dialect | pip3 install | import | Dependencies |\n' +
464+
'| Dialect | pip3 install | import | Dependencies |\n' +
465465
'+------------+--------------+----------+----------------------------------+\n';
466466

467467
const DIAGRAM_95_B =
468468
'┏━━━━━━━━━━━━┯━━━━━━━━━━━━━━┯━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n' +
469-
'┃ Dialect │ pip3 install │ import │ Dependencies ┃\n' +
469+
'┃ Dialect │ pip3 install │ import │ Dependencies ┃\n' +
470470
'┠────────────┼──────────────┼──────────┼──────────────────────────────────┨\n' +
471471
'┃ mysql │ mysqlclient │ MySQLdb │ www.pypi.org/project/mysqlclient ┃\n' +
472472
'┃ postgresql │ psycopg2 │ psycopg2 │ www.pypi.org/project/psycopg2 ┃\n' +

0 commit comments

Comments
 (0)