This tool allows to gather statistical profile of CPU usage of mixed native-Python code.

Overview

Sampling Profiler for Python Build Status

This tool allows to gather statistical profile of CPU usage of mixed native-Python code. Currently supported platforms are Windows and Linux, x86_64 only.

Quick usage guide for Ubuntu 18.04.

Required for Linux:

  • python-dev package
  • setuptools python package
  • autoconf tool
  • libtool
  • make tool
  • unzip tool
  • g++ compiler
  • pkg-config tool
  • cmake tool

Required for Windows:

  • python installed
  • cmake
  • Visual Studio compilers, version depends on which Python version you want to target, see correct MSVC version

Before building do:

  • On Linux:
    • git submodule update --init --recursive
    • cd 3rd_party && ./prereq-build.sh && cd ..
  • On Windows:
    • Update third-party intel-xed, mbuild, protobuf, protobuf-c and safestringlib submodules (3rd_party folder):
      • git submodule update --init -- .\3rd_party\intel-xed
      • git submodule update --init -- .\3rd_party\mbuild
      • git submodule update --init -- .\3rd_party\protobuf
      • git submodule update --init -- .\3rd_party\protobuf-c
      • git submodule update --init -- .\3rd_party\safestringlib
    • Apply protobuf-c-vs2008-support.patch (step is required for Python 2 target only):
      • cd 3rd_party\protobuf-c && git apply ..\protobuf-c-vs2008-support.patch && cd ..\..
    • If you have installed VS2017 or VS2019, apply next command (optional step) in the same command line prompt window in which next command will be applied (please note, that path to the vcvars64.bat file may vary by version of VS installed):
      • CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvars64.bat" -vcvars_ver=14.0
    • For Python 2.x run:
      • cd 3rd_party && prereq-build-py2.cmd && cd ..
    • For Python 3.5 or 3.6 run:
      • cd 3rd_party && prereq-build-py3.cmd && cd ..
    • For other versions of 3.x (untested) try fixing the file up specifying correct MSVC version

For building do:

  • mkdir pyext/build
  • cd pyext/build
  • On Windows:
    • For Python 2.x:
      • cmake -G "Visual Studio 9 2008 Win64" -DCMAKE_BUILD_TYPE=Release .. -DPYTHON_EXECUTABLE=path\to\python.exe
    • For Python 3.5 or 3.6:
      • cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=Release .. -DPYTHON_EXECUTABLE=path\to\python.exe
    • Open generated "pysamprof.sln" with VS2008 (if Python 2) or VS2015 (if Python 3), choose "Release" "x64" as solution configuration
    • Build solution
    • Copy Release\pysamprof.pyd and trace_writer\Release\pysamprof-server.exe to desired location
  • On Linux:
    • cmake -DCMAKE_BUILD_TYPE=Release .. -DPYTHON_EXECUTABLE=path/to/python
    • make
    • Copy pysamprof.so and trace_writer/pysamprof-server to desired location
  • NOTE: specifying -DPYTHON_EXECUTABLE=path/to/python will force which Python version to compile against; if omitted it will select highest available Python on your system.

To use:

  • Add path to location which has pysamprof and pysamprof-server inside to PYTHONPATH
  • Do import pysamprof then pysamprof.start(target_path), see pyext/test.py as a quick reference
Owner
Intel Corporation
Intel Corporation
Shrapnel is a scalable, high-performance cooperative threading library for Python.

This Python library was evolved at IronPort Systems and has been provided as open source by Cisco Systems under an MIT license. Intro Shrapnel is a li

216 Nov 06, 2022
Silky smooth profiling for Django

Silk Silk is a live profiling and inspection tool for the Django framework. Silk intercepts and stores HTTP requests and database queries before prese

Jazzband 3.7k Jan 01, 2023
Django query profiler - one profiler to rule them all. Shows queries, detects N+1 and gives recommendations on how to resolve them

Django Query Profiler This is a query profiler for Django applications, for helping developers answer the question "My Django code/page/API is slow, H

Django Query Profiler 116 Dec 15, 2022
This tool allows to gather statistical profile of CPU usage of mixed native-Python code.

Sampling Profiler for Python This tool allows to gather statistical profile of CPU usage of mixed native-Python code. Currently supported platforms ar

Intel Corporation 13 Oct 04, 2022
guapow is an on-demand and auto performance optimizer for Linux applications.

guapow is an on-demand and auto performance optimizer for Linux applications. This project's name is an abbreviation for Guarana powder (Guaraná is a fruit from the Amazon rainforest with a highly ca

Vinícius Moreira 19 Nov 18, 2022
PerfSpect is a system performance characterization tool based on linux perf targeting Intel microarchitectures

PerfSpect PerfSpect is a system performance characterization tool based on linux perf targeting Intel microarchitectures. The tool has two parts perf

Intel Corporation 139 Dec 30, 2022
Pyccel stands for Python extension language using accelerators.

Pyccel stands for Python extension language using accelerators.

Pyccel 242 Jan 02, 2023
Pearpy - a Python package for writing multithreaded code and parallelizing tasks across CPU threads.

Pearpy The Python package for (pear)allelizing your tasks across multiple CPU threads. Installation The latest version of Pearpy can be installed with

MLH Fellowship 5 Nov 01, 2021
A low-impact profiler to figure out how much memory each task in Dask is using

dask-memusage If you're using Dask with tasks that use a lot of memory, RAM is your bottleneck for parallelism. That means you want to know how much m

Itamar Turner-Trauring 23 Dec 09, 2022
Rip Raw - a small tool to analyse the memory of compromised Linux systems

Rip Raw Rip Raw is a small tool to analyse the memory of compromised Linux systems. It is similar in purpose to Bulk Extractor, but particularly focus

Cado Security 127 Oct 28, 2022
Sampling profiler for Python programs

py-spy: Sampling profiler for Python programs py-spy is a sampling profiler for Python programs. It lets you visualize what your Python program is spe

Ben Frederickson 9.5k Jan 01, 2023
Cinder is Instagram's internal performance-oriented production version of CPython

Cinder is Instagram's internal performance-oriented production version of CPython 3.8. It contains a number of performance optimizations, including bytecode inline caching, eager evaluation of corout

Facebook Incubator 2.2k Dec 30, 2022
Python compiler that massively increases Python's code performance without code changes.

Flyable - A python compiler for highly performant code Flyable is a Python compiler that generates efficient native code. It uses different techniques

Flyable 35 Dec 16, 2022