From a852583c4e96c60995e8913d6c1fde89603eab61 2016-02-15 15:16:47 From: Miguel Valdez Date: 2016-02-15 15:16:47 Subject: [PATCH] speedTools.bash updated and tested --- diff --git a/schainpy/speedTools.bash b/schainpy/speedTools.bash index 453c357..70024c9 100644 --- a/schainpy/speedTools.bash +++ b/schainpy/speedTools.bash @@ -1,8 +1,11 @@ +#Use this script in order to find the slowest module or function in your python code. +#Reference: http://lukauskas.co.uk/articles/2014/02/12/how-to-make-python-faster-without-trying-that-much/ + #!/bin/sh -filename = "testRawData.py" -output = "output" +script = "testRawData.py" +output = "profile.pdf" -python -m cProfile -o $output $filename +python -m cProfile -o profile.pstats $script -gprof2dot -f pstats $output.pstats | dot -Tpng -o $output.png \ No newline at end of file +gprof2dot -f pstats profile.pstats | dot -Tpdf -o $output \ No newline at end of file