fb8222874d
The Craft Scheduler still uses the primary thread for task scheduling. This results in the main thread still having to do work as part of the dispatching of async tasks. If plugins make use of lots of async tasks, such as particle emitters that want to keep the logic off the main thread, the main thread still receives quite a bit of load from processing all of these queued tasks. Additionally, resizing and managing the pending entries for all of these asynchronous tasks takes up time on the main thread too. This commit replaces the implementation of the scheduler when working with asynchronous tasks, by forwarding calls to the new scheduler. The Async Scheduler uses a single thread executor for "management" tasks. The Management Thread is responsible for all adding and dispatching of scheduled tasks. The mainThreadHeartbeat will send a heartbeat task to the management thread with the currentTick value, so that it can find which tasks to execute. Scheduling of an async tasks also dispatches a management task, ensuring that any Queue resizing operation occurs off of the main thread. The async queue uses a complete separate PriorityQueue, ensuring that resize operations are decoupled from the sync tasks queue. Additionally, an optimization was made that if a plugin schedules a single, non repeating, no delay task, that we immediately dispatch it to the executor pool instead of scheduling it. This avoids an unnecessary round trip through the queue, as well as will reduce the size growth of the queue if a plugin schedules lots of asynchronous tasks. |
||
---|---|---|
.github | ||
licenses | ||
scripts | ||
Spigot-API-Patches | ||
Spigot-Server-Patches | ||
work | ||
.gitignore | ||
.gitmodules | ||
.travis.yml | ||
CONTRIBUTING.md | ||
LICENSE.md | ||
paper | ||
pom.xml | ||
README.md |
Paper
High performance Spigot fork that aims to fix gameplay and mechanics inconsistencies.
IRC Support and Project Discussion
Documentation
Access the Paper docs here: paper.readthedocs.io
Access the Paper API javadocs here: paperdocs.emc.gs
How To (Server Admins)
Paperclip is a jar file that you can download and run just like a normal jar file.
Download a copy of paperclip.jar from our build server, here.
Run the Paperclip jar directly from your server. Just like old times
Paper requires Java 8 or above.
How To (Compiling Jar From Source)
To compile Paper, you need JDK 8, maven, and an internet connection.
Clone this repo, run ./paper jar
from bash, get files.
How To (Pull Request)
See Contributing
Special Thanks To:
YourKit, makers of the outstanding java profiler, support open source projects of all kinds with their full featured Java and .NET application profilers. We thank them for granting Paper an OSS license so that we can make our software the best it can be.