Wednesday, 21 December 2011

Профилирование проектов на Python

apt-get install -y python-profiler

Запускаем скрипт:
python -m profile login_to_mysql.py
test data
6 function calls in 0.000 CPU seconds

Ordered by: standard name

ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 0.000 0.000 :0(execfile)
1 0.000 0.000 0.000 0.000 :0(setprofile)
1 0.000 0.000 0.000 0.000 :1()
1 0.000 0.000 0.000 0.000 login_to_mysql.py:3()
1 0.000 0.000 0.000 0.000 profile:0(execfile('login_to_mysql.py'))
0 0.000 0.000 profile:0(profiler)
1 0.000 0.000 0.000 0.000 testinclude.py:4()

Вот так вот легко и просто :)

No comments:

Post a Comment

Note: only a member of this blog may post a comment.