Skip to main content

bprof

A Better PROFiler

Introduction

The reason bprof exists is that the major Python profiling packages simply don't profile robustly. They use timestamps and ad-hoc methods for keeping track of how time passes. For example, one approach is to timestamp when a function starts and when it stops, and then count this as the function time. This includes time spent in the profiling hooks.

The approach taken here is to integrate all of the time between hooks and add it to the appropriate records. By registering for all hooks except for opcodes, the time spent out of the profiler is directly measured. The time is measured right after entering bprof, and right before exiting. This allows for as rigorous time measurement as possible. Then, stacks are used to track the current contexts and record detailed profiling information.

Example

Code:

import bprof._bprof as bp
import time


def f():
    time.sleep(1)


bp.start()
f()
bp.stop()
bp.dump("")

Results:

Name: f, 1.2142e-05
1.00074(6.21e-07/1.00074):     time.sleep(1)
Name: <built-in function stop>, 0
Name: <built-in function sleep>, 1.00074

Future

There is a lot of future work. This is just a first pass.

  • Save statistics

History

0.1.0 (2019-10-10)

  • First release on PyPI.

Metadata

Release files for bprof 0.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bprof 0.5.2
File Size Uploaded Provenance Actions
bprof-0.5.2.tar.gz 13.7 kB Without provenance Details for bprof-0.5.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bprof 0.5.2
File Interpreter ABI Platform Actions
bprof-0.5.2-cp37-cp37m-macosx_10_14_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.14+ x86-64 Details for bprof-0.5.2-cp37-cp37m-macosx_10_14_x86_64.whl

Total release size: 38.1 kB

Release files / bprof-0.5.2.tar.gz

Download URL bprof-0.5.2.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
65e836dc5ad4427fa98ae6673a01301379331f8298a4e3c0cf80861c9577b772
BLAKE2b-256 checksum
How to use checksums
c17cb06c60054dbe74221203c52a670b4d37b2c842dd7283e69165e0120c512f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.4

Release files / bprof-0.5.2-cp37-cp37m-macosx_10_14_x86_64.whl

Download URL bprof-0.5.2-cp37-cp37m-macosx_10_14_x86_64.whl
Size 24.4 kB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.14+ x86-64
SHA-256 checksum
How to use checksums
be0209504e95c9caaa91740a174260ead3e608f1d5ac15046e979c54cd9742fb
BLAKE2b-256 checksum
How to use checksums
8d70410e81248261187eb1782f650f38a5233f49359daaf7668cb7eb6d610cef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.4

Security for bprof 0.5.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.5.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page