flex icon indicating copy to clipboard operation
flex copied to clipboard

Set XDEBUG_MODE=off when running cache:clear command via auto-scripts

Open Seldaek opened this issue 2 years ago • 3 comments

As https://github.com/symfony/flex/issues/743 was rejected (and I can't really argue with the reasoning tbh) - it would be nice to set XDEBUG_MODE=off in the env while running cache:clear, as running a cache warmup with xdebug enabled can have quite a big impact on perf (seeing 60-70% less CPU time here).

Of course everyone can fix this themselves, but doing it here would improve the experience for everyone at once.

I'd argue perhaps the cache:clear command could use something like composer/xdebug-handler even to force itself being run without xdebug, but that's a more invasive change.

Seldaek avatar Jul 04 '22 19:07 Seldaek

I don't know if this is a good solution to everyone. cache:clear is not just clearing cache, it is also running a warmup and validating if your code is correctly written. Not sure how much of this validation needs (if it even takes advantage of) xdebug, but its better for xdebug to be on during debugging than not, including the automatic debugging.

Though having a --dont-debug option would be nice. Its so annoyoing when I am working on service A and when I am trying to test if it works I keep getting interrupted by "serivce B is invalid". I know its invalid, I have not finished it, because I need to finish service A first. Sorry for the rant.

hubertnnn avatar May 11 '23 14:05 hubertnnn

we gained 3m on build tests by adding export XDEBUG_MODE=off where needed

thanks! :100:

ro0NL avatar Nov 06 '23 11:11 ro0NL

little update, we disabled xdebug by default and enabled it when needed. I think it's the better approach, rather than disabling hardcoded.

ro0NL avatar Nov 08 '23 19:11 ro0NL