Re: Does loading PDB slow down execution?

2021-10-27 Thread Unixnut

On 06/10/2021 18:30, Dieter Maurer wrote:

Unixnut wrote at 2021-10-3 22:03 +0100:

If I run a python3 program with "import pdb" in the code, would it
execute slower than without loading the debugger?


Importing `pdb` does not slow down the application significantly
(it just adds the import time but does not otherwise affect the
application).

Only when you execute code under debugger control, the
execution is significantly slowed down (because the debugger
gets informed (via callbacks) about important "event"s (entering
a line, function call, function return, exception) during
the execution).

Excellent, many thanks for confirming. I can leave the execution running 
then.

--
https://mail.python.org/mailman/listinfo/python-list


Does loading PDB slow down execution?

2021-10-05 Thread Unixnut

Hi all,

If I run a python3 program with "import pdb" in the code, would it 
execute slower than without loading the debugger?


The program I am running is computationally expensive and mathematically 
orientated. It is expected to run for a few months (I am a few days in). 
I found out today that I forgot to comment out the "import pdb" while 
debugging, and now I am wondering if there would be a performance 
benefit worth restarting the execution with pdb unloaded.


I have tried testing this with a simple sum executable, but I don't see 
a clear difference with short execution times (<5 mins). Before I 
investigate further, I thought I would ask and see if anyone knows the 
answer already.


Many thanks!

--
https://mail.python.org/mailman/listinfo/python-list