Skip to main content

A small tool using perf to provide more performance insights.

Project description

microperf

PyPI downloads

microperf is a perf wrapper. The basic idea is that it converts a perf.data file by inserting all samples into a database, making it then easier to query for specific patterns or code smells.

Usage

Generating a profile

First, note that your executable should be compiled with debug symbols (-g, -DCMAKE_BUILD_TYPE=RelWithDebInfo, ...).

Since microperf is simply a wrapper, generating a profile can be done directly with perf.

perf record -F99 --call-graph=dwarf -- <COMMAND>

Alternatively, microperf perf provides a convenience passthrough to perf. This can be useful when a different perf executable should be used (see MICROPERF_PERF_EXE option below).

Running the Patterns analyzer

I've written a couple queries to identify common bad patterns. At time of this writing, this includes cycles spent in:

  1. tree-based structures (std::map, std::set): these can often be replaced with hash-based data structures.
  2. constructors: these are often signs of excessive copying.

Options

The environment variable MICROPERF_PERF_EXE can be set to the path of a perf executable to be used instead of the default perf command.

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

microperf-1.0.2.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

microperf-1.0.2-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file microperf-1.0.2.tar.gz.

File metadata

  • Download URL: microperf-1.0.2.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for microperf-1.0.2.tar.gz
Algorithm Hash digest
SHA256 47c7362dc5844043040243849752d6e59711c916836234b4503109bba9ff868f
MD5 1b6d7a4e767016bac92d9f29d8baaef1
BLAKE2b-256 4ce2335d31a82350bfef02663454b042a399e641c7b48402536f33c3a97abcb4

See more details on using hashes here.

Provenance

The following attestation bundles were made for microperf-1.0.2.tar.gz:

Publisher: release.yml on nicovank/microperf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file microperf-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: microperf-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for microperf-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 071688f242bbd6b573bdbe654a1b120b0a210fa95c6f4ffbe1035d9ce2ec1636
MD5 447936115c12fa459f93c0c81e2e0e35
BLAKE2b-256 53f11ff8ecd82b96686bc8d74e6c0934a82c0aedef35160029eff2b00ad1d925

See more details on using hashes here.

Provenance

The following attestation bundles were made for microperf-1.0.2-py3-none-any.whl:

Publisher: release.yml on nicovank/microperf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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