Tech Triumph: CPU Throttling Resolved in Groundbreaking Update
Farcaster's Shuttle Engine Eliminates Unnecessary CPU Drain, Restoring Efficiency in Latest Release #2228
Commit Details:
fix(shuttle): Don't throttle CPU when there are no events to process (#2228) ## Why is this change needed? We accidentally introduced a change in 0.5.6 which lead to higher CPU usage since we're no longer sleeping. ## Merge Checklist - [x] PR title adheres to the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) standard - [x] PR has a [changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets) - [ ] PR has been tagged with a change label(s) (i.e. documentation, feature, bugfix, or chore) - [ ] PR includes [documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs) if necessary. <!-- start pr-codex --> --- ## PR-Codex overview The focus of this PR is to fix a CPU throttling regression introduced in version 0.5.6 of `@farcaster/shuttle`. ### Detailed summary - Added logic to prevent CPU thrashing when no events are present in `eventStream.ts`. - Introduced a sleep function to pause processing when no events are available. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->