[Python] How safe is it to use the sys.monitoring api to profile python code?

Discussão em 'Python' iniciado por Stack, Junho 8, 2025.

  1. Stack

    Stack Membro Participativo

    As a side project, I have created lblprof, a python module that profile code execution and display time spent on each line in a tree format.

    I use it to debug code performance while developing and I am pretty happy about it.

    However, this tool is based on the sys.monitoring api introduced in python 3.12 and I don't see either a lot of projects or a lot of documentation about this api.

    I wonder how safe it is for a normal developper like me to interact with this module ? Have you already used sys.monitoring in a production / professional environment ?

    Thanks

    Continue reading...

Compartilhe esta Página