Conversation
We've observed that we'll spend a good amount of CPU doing the busy loop, meaning the system decided not really to yield the CPU. Sleeping will actually yield the CPU, which increases the chance that the other thread will do its work. This is not particularly problematic. It's mostly annoying to see in the profiles when trying to identify areas to attack to reduce it.
d1d5073 to
3cbd7cc
Compare
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3645 +/- ##
==========================================
+ Coverage 62.11% 62.12% +0.01%
==========================================
Files 141 141
Lines 13387 13387
Branches 1753 1753
==========================================
+ Hits 8315 8317 +2
+ Misses 4273 4270 -3
- Partials 799 800 +1 see 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Benchmarks [ profiler ]Benchmark execution time: 2026-02-12 16:35:55 Comparing candidate commit 3cbd7cc in PR branch Found 3 performance improvements and 5 performance regressions! Performance is the same for 21 metrics, 7 unstable metrics. scenario:php-profiler-exceptions-with-profiler-and-timeline
scenario:php-profiler-timeline-memory-control
scenario:php-profiler-timeline-memory-with-profiler
scenario:php-profiler-timeline-memory-with-profiler-and-timeline
|
|
If I remember the discussion and our work on #1919 I think the conclusion was that there is no way this can happen besides a A bit later we added a fix for disabling the profiler while PHP FPM is doing preloading and way after that, we switched to What I want to say: maybe with disabling profiling in preloading and handling |
I think so too but the cost of being wrong is crashes so... I'm not sure it's worth it. The cost of maintaining this helper is very low. |
realFlowControl
left a comment
There was a problem hiding this comment.
Personally I would completely get rid of this code path and just join() because I am very confident we fixed the root cause to this issue a while ago already, see my other comment.
OTOH this only adds 100ms in MSHUTDOWN, it is most likely negligible and definitely this will lower CPU, because on most multi core machines, there will be nothing for sched_yield() to yield to 😉
Description
We've observed that we'll spend a good amount of CPU doing the busy loop, meaning the system decided not really to yield the CPU. Sleeping will actually yield the CPU, which increases the chance that the other thread will do its work. I think 100ms should still feel responsive.
This is not particularly problematic. It's mostly annoying to see in the profiles when trying to identify areas to attack to reduce it. This is why I marked it "fix" and not "perf."
Reviewer checklist