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
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
21342133def 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 > 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
0 commit comments