Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #17569 > unrolled thread

profiling code

Started byAndrea Crotti <andrea.crotti.0@gmail.com>
First post2011-12-20 10:40 +0000
Last post2011-12-20 10:40 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  profiling code Andrea Crotti <andrea.crotti.0@gmail.com> - 2011-12-20 10:40 +0000

#17569 — profiling code

FromAndrea Crotti <andrea.crotti.0@gmail.com>
Date2011-12-20 10:40 +0000
Subjectprofiling code
Message-ID<mailman.3858.1324377616.27778.python-list@python.org>
I would like to automate some kind of performance profiling, to see if
the application (and possibly pieces of it) becomes slower/faster and why.

So I did something like this, where the statement passed also called 
parse_arguments,
which is nice because I can run the other script with the normal options.
But how do I pass arguments to the performance analyser script then?

def profile_startup():
     # just run something from inside here
     code = 
compile('Develer(parse_arguments()).full_run(test_only=True)', 
'dev_main', 'exec')
     results = 'profiled.prof'
     runctx(code, globals(), {}, filename=results)

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web