All Projects → glumia → pylaprof

glumia / pylaprof

Licence: MIT license
A Python sampling profiler for AWS Lambda functions (and not only).

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to pylaprof

bytehound
A memory profiler for Linux.
Stars: ✭ 2,639 (+21891.67%)
Mutual labels:  profiler, profiling
Laravel Db Profiler
Database Profiler for Laravel Web and Console Applications.
Stars: ✭ 141 (+1075%)
Mutual labels:  profiler, profiling
Memory Profiler
A memory profiler for Linux.
Stars: ✭ 2,422 (+20083.33%)
Mutual labels:  profiler, profiling
kokkos-tools
Kokkos C++ Performance Portability Programming EcoSystem: Profiling and Debugging Tools
Stars: ✭ 52 (+333.33%)
Mutual labels:  profiler, profiling
VisualProfiler-Unity
The Visual Profiler provides a drop in solution for viewing your mixed reality Unity application's frame rate, scene complexity, and memory usage.
Stars: ✭ 120 (+900%)
Mutual labels:  profiler, profiling
profiling
Non-discriminatory profiling of Ruby code leveraging the ruby-prof gem
Stars: ✭ 12 (+0%)
Mutual labels:  profiler, profiling
Py Spy
Sampling profiler for Python programs
Stars: ✭ 7,709 (+64141.67%)
Mutual labels:  profiler, profiling
Scalene
Scalene: a high-performance, high-precision CPU, GPU, and memory profiler for Python
Stars: ✭ 4,819 (+40058.33%)
Mutual labels:  profiler, profiling
Nlp profiler
A simple NLP library allows profiling datasets with one or more text columns. When given a dataset and a column name containing text data, NLP Profiler will return either high-level insights or low-level/granular statistical information about the text in that column.
Stars: ✭ 181 (+1408.33%)
Mutual labels:  profiler, profiling
Tracy
C++ frame profiler
Stars: ✭ 3,115 (+25858.33%)
Mutual labels:  profiler, profiling
audria
audria - A Utility for Detailed Ressource Inspection of Applications
Stars: ✭ 35 (+191.67%)
Mutual labels:  profiler, profiling
flamescope
Export flame data to speedscope's format
Stars: ✭ 26 (+116.67%)
Mutual labels:  flamegraph, profiling
Speedscope
🔬 A fast, interactive web-based viewer for performance profiles.
Stars: ✭ 3,256 (+27033.33%)
Mutual labels:  flamegraph, flamegraphs
FlameViewer
Tool for flamegraphs visualization
Stars: ✭ 76 (+533.33%)
Mutual labels:  profiler, flamegraph
Flamegraph
Easy flamegraphs for Rust projects and everything else, without Perl or pipes <3
Stars: ✭ 2,185 (+18108.33%)
Mutual labels:  profiling, flamegraphs
Hotspot
The Linux perf GUI for performance analysis.
Stars: ✭ 2,415 (+20025%)
Mutual labels:  profiler, profiling
Myperf4j
High performance Java APM. Powered by ASM. Try it. Test it. If you feel its better, use it.
Stars: ✭ 2,281 (+18908.33%)
Mutual labels:  profiler, profiling
profiler
Continuous profiling based on pprof
Stars: ✭ 221 (+1741.67%)
Mutual labels:  profiler, profiling
ghc-stack
Hacking GHC's Stack for Fun and Profit (featuring The Glorious Haskell Debugger v0.0.1 Pre-alpha)
Stars: ✭ 69 (+475%)
Mutual labels:  profiling
parca
Continuous profiling for analysis of CPU and memory usage, down to the line number and throughout time. Saving infrastructure cost, improving performance, and increasing reliability.
Stars: ✭ 2,834 (+23516.67%)
Mutual labels:  profiling

pylaprof

pylaprof is a Python library that allows you to profile functions or sections of code.

As a decorator:

from pylaprof import profile

@profile()
def handler(event, context):
  ...

As a context manager:

from pylaprof import Profiler

def main():
  ...
  with Profiler():
    # Only code inside this context will be profiled.
    ...

It is built around three main abstractions: the profiler, the sampler, and the storer.

The profiler is the main component of pylaprof, it takes care of taking snapshots of your program's stack at regular intervals and feeding them to the sampler for processing; at the end of the profiling session, it will then ask the sampler for a report and provide it to the storer.

Take a look at the source for more documentation and some pre-implemented samplers and storers or here for some usage examples.

Features

  • Accessible: pylaprof's code is thoroughly documented and written to be read and understood by other humans.

  • Extensible: you can write your own sampler or storer to generate reports in the format you like and store them where and how you want.

  • Zero external dependencies1.

  • Close to zero impact on performances (check benchmark for more details).

  • Reliable: pylaprof was built with the context of long-running applications or continuously invoked lambda functions in mind. It will never break your code or pollute your standard output or error with unwanted messages.

  • Turn on/off profiling with an environment variable.

  • Store the profiling report only if execution takes longer than a threshold.

pylaprof-merge

pylaprof-merge is a CLI tool to merge multiple stackcollapse reports into a single one. This might come in handy if you want to get an aggregated overview of a function or piece of code that is executed frequently for short periods. It is installed automatically if you get pylaprof with pip.

Installation

pip install pylaprof

Or just copy-paste the pylaprof directory where you need it.

Credits

  • This library is heavily inspired to pprofile: thanks to its authors for writing such accessible and well-documented code.
  • Thanks to @jvns for writing and distributing some of her wizard zines for free: that's what got me into the rabbit hole of profiling in the first place.

Footnotes

  1. boto3 is optional and required only if you want to use the S3 storer.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].