Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fixed issue #1755: Overload pcntl_fork() to prevent performance degradation by calling xdebug_get_pid often #556
In version 2.7 a change was introduced to restart the debugger if the process id changed. This was added to fix issue # 938 which stopped you from correctly debugging forked processes after using pnctl_fork() . The problem is that now we are calling xdebug_get_pid in a lot of places and this slows down the debugger a lot. It is not actually necessary to be calling xdebug_get_pid continually as we can just do that when the process is forked and restart the debugger at that point if needed. We do this by overriding the pnctl_fork() php function and checking the process id and restarting the debugger if needed there
By doing this, the measured time to run this php code when connected to a debugging client
decreased from 2:16 min to 0:59min
derickr left a comment
thanks for this. I have a few comments.
Besides the comments, would you also please use the correct commit message format? All fixes in Xdebug with links to the issue tracker are in the following form:
Fixed issue #1755: Overload pcntl_fork() to prevent performance degradation by calling xdebug_get_pid often
I prefer my commit messages (and Issue Summary) to be an active change and say what it improved, and not what was broken before. It makes for a much easier to read change log.