Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Improve performance of StreamSelectLoop when no timers are scheduled
  • Loading branch information
clue committed Feb 23, 2022
commit a89338551f073f5a81a5ae14579e28ff31dd2913
5 changes: 5 additions & 0 deletions src/Timer/Timers.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ public function isEmpty()

public function tick()
{
// hot path: skip timers if nothing is scheduled
if (!$this->schedule) {
return;
}

// ensure timers are sorted so we can execute in order
if (!$this->sorted) {
$this->sorted = true;
Expand Down