Open Seldaek opened 2 years ago
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.
we gained 3m on build tests by adding export XDEBUG_MODE=off
where needed
thanks! :100:
little update, we disabled xdebug by default and enabled it when needed. I think it's the better approach, rather than disabling hardcoded.
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.