Skip to main content

Decorators for profiling individual functions

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

profilehooks-1.4.tar.gz (8.5 kB view details)

Uploaded Source

File details

Details for the file profilehooks-1.4.tar.gz.

File metadata

  • Download URL: profilehooks-1.4.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for profilehooks-1.4.tar.gz
Algorithm Hash digest
SHA256 f76adad570bc9517289c3370d1aed9d0360d2fdeee1c2fcdaa3ad7dc3e4ccd79
MD5 1246846fed9f46e5199eedfe006cd424
BLAKE2b-256 5eff8036f396be82f63dbac3f83191e36dc5d64c2669638b8a0e4eb708202f16

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page