mirror of
https://github.com/PaperMC/Folia.git
synced 2025-04-23 04:39:19 +08:00
The old region scheduler had a few problems: 1. Inability to process intermediate tasks (chunk/packets) leading to higher than Paper/Vanilla latencies for task processing 2. Thread swapping: scheduled tasks had no thread preference, which lead to them swapping threads which may not be cache efficient The new scheduler solves both of these issues. The new scheduler can process intermediate tasks, and combined with the new packet scheduler this allows packets to be processed at low latency provided that the scheduler threads are idle or waiting. The new scheduler will only move a scheduled tick/task to another scheduling thread provided that its scheduled start is missed by a specified time (for now, 2ms). This should ensure that thread swapping only occurs to meet scheduling deadlines.