Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install profilehooks

How to install profilehooks

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install profilehooks
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
1.5
1.6Never BuiltWhy not?
1.5 Available View build log
Windows (64-bit)
1.5
1.6Never BuiltWhy not?
1.5 Available View build log
Mac OS X (10.5+)
1.5
1.6Never BuiltWhy not?
1.5 Available View build log
Linux (32-bit)
1.5
1.6Never BuiltWhy not?
1.5 Available View build log
Linux (64-bit)
1.6 Available View build log
1.5 Available View build log
1.6 Available View build log
 
License
MIT
Imports
Lastest release
version 1.6 on Sep 20th, 2013

profilehooks

It's a collection of decorators for profiling functions. E.g. to profile a single function:

from profilehooks import profile

@profile
def my_function(args, etc):
    pass

The results will be printed when the program exits (or you can use @profile(immediate=True)).

If you're interested in coarse timings and don't want to pay for the overhead of profiling, use

from profilehooks import timecall

@timecall       # or @timecall(immediate=True)
def my_function(args, etc):
    pass

Finally, you may be interested in seeing line coverage for a single function

from profilehooks import coverage

@coverage
def my_function(args, etc):
    pass

Full documentation is available through pydoc profilehooks after installation.

The home page for this module is http://mg.pov.lt/profilehooks. It has screensho, uh, that is, more examples.

Changelog

1.6 (2012-06-05)
1.5 (2010-08-13)
  • New argument to @timecall: timer (defaults to time.time). Example: @timecall(timer=time.clock)
  • Better documentation.
1.4 (2009-03-31)
  • Added support for cProfile, make it the default profiler when available. Previously profilehooks supported profile and hotshot only.
1.3 (2008-06-10)
  • Store profile results (when you pass filename to @profile) in pstats format instead of pickles. Contributed by Florian Schulze.
1.2 (2008-03-07)
  • New argument to: @timecall: immediate (defaults to False).
  • Added a test suite.
1.1 (2007-11-07)
  • First release to PyPI, with a setup.py and everything.
  • New arguments to @profile: dirs, sort, entries. Contributed by Hanno Schlichting.
  • Preserve function attributes such as __doc__ and __module__ when decorating them.
  • Pydoc-friendly docstring wrapping and other docstring improvements.
1.0 (2006-12-06)
  • Changed licence from GPL to MIT.
  • New decorator: @timecall
  • New arguments to @profile: skip, filename, immediate.
  • Added support for profile, after becoming convinced hotshot was unreliable. Made it the default profiler.
0.1 (2004-12-30)
  • First public release (it didn't actually have a version number), announced on my blog: http://mg.pov.lt/blog/profiling.html
  • @profile and @coverage decorators that didn't accept any arguments.
  • hotshot was the only profiler supported for @profile, while @coverage used trace.py

Subscribe to package updates

Last updated Sep 20th, 2013

Download Stats

Last month:3

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.