Profiler modules for fun and profit...

I wrote a silly little profiler module yesterday (that is, an actual profiler, not a profile viewer).  It's currently a Python-coded profiler, so pretty much useless, but it was very fun to write :) .  It captures the same basic data as cProfile (that is, it does run-time compression of the data-set rather than logging all events), but with line-timings.  Mostly I created it because on my machine hotshot doesn't seem to actually capture line-timings and I wanted a simple test-case for adding line-timing functionality for RunSnakeRun (that is, for figuring out how to display/integrate line timings).

Robert had to hit me upside the head with a clue-bat to get me to realize that his line_profiler is actually *just* a line profiler, that is, it doesn't capture function-level data at all, its intended to be used for timing a single or a small set of functions, not for line-profiling an entire application.

I'll probably rewrite sillyprofiler so that it uses the same basic machinery as line_profiler (i.e. make it a cython application), there's no way it will be as fast as hotshot/cProfile, as it does its bookkeeping with Python objects, but it might be sufficiently fast to be useful, and being in Cython should make it reasonably maintainable.  I want to add multi-threading support before converting it, however.

I should be refactoring RunSnakeRun at some point so that the various loaders can specify, for instance, what fields they want in the GUI tables, their hierarchic adapters, how to identify their files... infinite possibilities.


Comments are closed.


Pingbacks are closed.