@@ -1,8 +1,11 | |||||
|
1 | #Use this script in order to find the slowest module or function in your python code. | |||
|
2 | #Reference: http://lukauskas.co.uk/articles/2014/02/12/how-to-make-python-faster-without-trying-that-much/ | |||
|
3 | ||||
1 | #!/bin/sh |
|
4 | #!/bin/sh | |
2 |
|
5 | |||
3 |
|
|
6 | script = "testRawData.py" | |
4 |
output = " |
|
7 | output = "profile.pdf" | |
5 |
|
8 | |||
6 |
python -m cProfile -o |
|
9 | python -m cProfile -o profile.pstats $script | |
7 |
|
10 | |||
8 |
gprof2dot -f pstats |
|
11 | gprof2dot -f pstats profile.pstats | dot -Tpdf -o $output No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now