Redesign CLI executor to avoid spin looping when idle#4994
Redesign CLI executor to avoid spin looping when idle#4994jedel1043 merged 10 commits intoboa-dev:mainfrom
Conversation
Test262 conformance changes
Tested main commit: |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4994 +/- ##
===========================================
+ Coverage 47.24% 59.76% +12.51%
===========================================
Files 476 589 +113
Lines 46892 63476 +16584
===========================================
+ Hits 22154 37934 +15780
- Misses 24738 25542 +804 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Test262 conformance changes
Tested main commit: |
|
there are merge conflicts now? and can we pls merge this asap. i have the tendency to forget closing the cli and my core 1 suffers for this 🥹 |
nekevss
left a comment
There was a problem hiding this comment.
LGTM
We should definitely merge this as soon as possible
The design of our current event loop on the CLI has a couple of warts; one of them being that if there are any async jobs or timeout jobs but not any other type of job on the queue, it will start spin looping, consuming a lot of CPU resources.
This PR completely redesigns our event loop to use
smoland cooperative async tasks to push the jobs forward, which avoids spin looping by delegating pauses and timeouts tosmol(effectively delegating those to the OS, and OS sleeping = 0% CPU usage). This redesign also modularizes the way jobs are ran; instead of having a big loop that goes through all of the job queues at once, it extracts the running logic of each job queue into independent async tasks