Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Python Profiling 101

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for Nazar Kanaev Nazar Kanaev
September 22, 2020

Python Profiling 101

Avatar for Nazar Kanaev

Nazar Kanaev

September 22, 2020
Tweet

More Decks by Nazar Kanaev

Other Decks in Programming

Transcript

  1. dynamic program analysis to measure usage / time / memory

    of function calls / instructions / etc.
  2. OS-level API py-spy: process_vm_readv (linux) / vm_read (macos) / ReadProcessMemory

    (windows) fil: malloc/calloc/alloc/free (linux & macos)
  3. pure-python profilers add more overhead than the compiled ones choose

    the latter if execution speed is more important
  4. deterministic profiling is accurate, but slower than sampling profiling for

    long-running tasks sampling profiling might be more preferred