Hacker News new | ask | show | jobs
by kapilvt 2069 days ago
ptrace is quite slow, py-spy reads memory and reconstructs stack frames which is much lower overhead for the profiled app.

from their github readme:

  py-spy works by directly reading the memory of the python program using the process_vm_readv system call on Linux, the vm_read call on OSX or the ReadProcessMemory call on Windows.