python-ptrace icon indicating copy to clipboard operation
python-ptrace copied to clipboard

the performance of -f option

Open kaizi-8lab opened this issue 8 years ago • 1 comments

hi, i want to know the program execution process ,when i use the -f option, the process will be very slowly。 for example, i excute command "apt-get install gedit" , it takes about 5 seconds. if i use " python2.7 ./strace.py -f apt-get install gedit",it takes 2.5 min, the time is unacceptable. i alse use linux strace, excute cmd "strace -f apt-get install gedit", it taks 20 second.
do you know the reason of being slowly?

kaizi-8lab avatar Apr 08 '17 08:04 kaizi-8lab

python-ptrace is implemented in Python, it's slower than strace which is written in C.

python-ptrace was never optimized, maybe there are some obvious non-efficient code. There is also a cptrace module which avoids the slow ctypes.

vstinner avatar Apr 08 '17 12:04 vstinner