It would be a really great improvement to have the performance impacts caused by Xdebug only during an active debugging session - without the need to enable and disable Xdebug manually every time.
A great and relatively simple way to do so is described here in detail:
https://jtreminio.com/blog/developing-at-full-speed-with-xdebug/
That means with Xdebug enabled you wouldn't have any performance impacts while just executing the web application. Only in an active debugging session (= when the cookie "XDEBUG_SESSION" is set) the performance impacts take effect.
Some good thinking. The only downside is that this then requires people to use a browser extension. And ddev xdebug on IMO is easier than a browser extension.
A browser extension is not necessarily needed to enable Xdebug from the client-side. IMO it's the most convenient way, but there are different ways like:
Initiating the debugging session from the client side is required in any case - this is nothing new or specific to the described improvement.
The described improvement does only one thing: a request is only handled by a PHP container with the Xdebug extension installed/enabled when a debugging connection was initiated by the client, otherwise a PHP container with no Xdebug installed/enabled will handle the request. So when just using/testing/whatever the web application is running at full speed and the bad performance Xdebug is causing only takes effect during a debugging session.
Note that xdebug 3.0 is out and it claims massively improved performance in this case. It is already used by PHP8.0 in ddev, and I expect that the upstream packager deb.sury.org may switch to xdebug 3.0 for PHP7.4 and maybe 7.3 as well.
WOW - I tried Xdebug 3.0 yesterday and the performance improvement is really impressive. When debugging is disabled on the client-side the performance of the web application is nearly as fast as with having the extension completely disabled.
So I think my feature request is obsolete with Xdebug 3.0 :D
Nevertheless thank you guys for your great work!
https://stackoverflow.com/questions/65137275/how-can-i-use-xdebug-3-0-with-php-7-3-or-7-4-in-ddev explains how to use Xdebug 3.0 with PHP7.3 and 7.4 on ddev v1.16.2
Most helpful comment
A browser extension is not necessarily needed to enable Xdebug from the client-side. IMO it's the most convenient way, but there are different ways like:
Initiating the debugging session from the client side is required in any case - this is nothing new or specific to the described improvement.
The described improvement does only one thing: a request is only handled by a PHP container with the Xdebug extension installed/enabled when a debugging connection was initiated by the client, otherwise a PHP container with no Xdebug installed/enabled will handle the request. So when just using/testing/whatever the web application is running at full speed and the bad performance Xdebug is causing only takes effect during a debugging session.