View Issue Details

IDProjectCategoryView StatusLast Update
0001755XdebugStep Debuggingpublic2020-03-28 15:18
ReporterbarelAssigned Toderick 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version2.9.2 
Target Version3.0.0devFixed in Version3.0.0dev 
Summary0001755: Overload pcntl_fork() to prevent performance degradation by calling xdebug_get_pid often
DescriptionIn 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
Steps To ReproduceUse xdebug and start a debugging session connected to a client. Performance will be degraded even if you do not fork the process
Tagsperformance
Operating System
PHP Version7.4.0-7.4.4

Relationships

has duplicate 0001681 resolvedderick Reduce cost of getpid() syscall to once per request/thread/process 

Activities

derick

2020-03-05 13:13

administrator   ~0005270

There is a pull request at https://github.com/xdebug/xdebug/pull/556

derick

2020-03-06 12:09

administrator   ~0005276

Are you sure pcntl_fork() is the only case where the original issue crept up? I am not so sure, and I wouldn't want to break this functionality.

barel

2020-03-06 12:14

reporter   ~0005277

I checked the documentation for the PCNTL PHP extension and other sources of PHP information and this was the only case that I could find where a child process was created. I saw that the initial issue was developed with the support of brad@rhift.com so maybe you could try to contact him to confirm his view on the issue

derick

2020-03-28 15:18

administrator   ~0005358

This is now merged into Git's master branch.

Issue History

Date Modified Username Field Change
2020-03-05 10:44 barel New Issue
2020-03-05 10:44 barel Tag Attached: performance
2020-03-05 13:13 derick Note Added: 0005270
2020-03-06 12:09 derick Assigned To => derick
2020-03-06 12:09 derick Status new => feedback
2020-03-06 12:09 derick Note Added: 0005276
2020-03-06 12:14 barel Note Added: 0005277
2020-03-06 12:14 barel Status feedback => assigned
2020-03-06 12:46 derick Summary Performance is degraded by calling xdebug_get_pid too often => Overload pcntl_fork() to prevent performance degradation by calling xdebug_get_pid often
2020-03-06 12:54 derick Status assigned => confirmed
2020-03-06 12:54 derick Target Version => 3.0.0dev
2020-03-12 16:27 derick Relationship added has duplicate 0001681
2020-03-12 16:33 derick Category Remote Debugging => Step Debugging
2020-03-28 15:18 derick Status confirmed => closed
2020-03-28 15:18 derick Resolution open => fixed
2020-03-28 15:18 derick Fixed in Version => 3.0.0dev
2020-03-28 15:18 derick Note Added: 0005358