Introduce dual-queue backed queue for the Affinity scheduler - #310
Merged
Conversation
…ermediate task processing Original concept idea created by Jan. This concept essentially introduces a 2nd priority queue ordered by the last insertion time, which is used later on to process intermediate tasks if the current tick we are waiting for does not have tasks to process. This improves efficiency of the scheduler and intermediate tasks, reducing latency of packet processing, chunk tasks, and tick tasks in the region. The new queue implementation is the SchedulableTickFastQueue, which is backed by 2 FastHeapPriorityQueue instances, "edf" and "queueTime". "edf" is ordered by EDF(earliest deadline first), maintaining the queue order for what tick needs to be processed next. "queueTime" is ordered by the insertion time of the schedulable tick into the EDF queue, with the head always being the task that was inserted the longest time ago. This should prove to be very useful and powerful for a lot of servers. Further optimizations will be done down the line to try and maximize the time spent processing intermediate tasks through load balancing optimizations that will be done at a later date.
R00tB33rMan
approved these changes
Aug 2, 2026
Toffikk
approved these changes
Aug 10, 2026
Contributor
|
yep, loved the original idea by Jan, looks like it's implemented nicely |
devnootnoot
self-requested a review
August 10, 2026 19:00
devnootnoot
approved these changes
Aug 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Original concept idea created by Jan.
This concept essentially introduces a 2nd priority queue ordered by the last insertion time, which is used later on to process intermediate tasks if the current tick we are waiting for does not have tasks to process. This improves efficiency of the scheduler and intermediate tasks, reducing latency of packet processing, chunk tasks, and tick tasks in the region.
The new queue implementation is the
SchedulableTickFastQueue, which is backed by 2FastHeapPriorityQueueinstances,edfandqueueTime.edfis ordered by EDF(earliest deadline first), maintaining the queue order for what tick needs to be processed next.queueTimeis ordered by the insertion time of the schedulable tick into the EDF queue, with the head always being the task that was inserted the longest time ago.This should prove to be very useful and powerful for a lot of servers. Further optimizations will be done down the line to try and maximize the time spent processing intermediate tasks through load balancing optimizations that will be done at a later date.
This marks this panel task as in-progress