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


Groups > comp.lang.python > #17569

profiling code

Date 2011-12-20 10:40 +0000
From Andrea Crotti <andrea.crotti.0@gmail.com>
Subject profiling code
Newsgroups comp.lang.python
Message-ID <mailman.3858.1324377616.27778.python-list@python.org> (permalink)

Show all headers | View raw


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)

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web