Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
MrPowerGamerBR committed Nov 17, 2023
1 parent cc5a154 commit 30bd3d6
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 4 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,22 @@ SparklyPaper's config file is `sparklypaper.yml`, the file is, by default, place

* Configurable Farm Land moisture tick rate when the block is already moisturised
* The `isNearWater` check is costly, especially if you have a lot of farm lands. If the block is already moistured, we can change the tick rate of it to avoid these expensive `isNearWater` checks.
* Skip `distanceToSqr` call in `ServerEntity#sendChanges` if the delta movement hasn't changed
* The `distanceToSqr` call is a bit expensive, so avoiding it is pretty nice, around ~15% calls are skipped with this check. Currently, we only check if both Vec3 objects have the same identity, that means, if they are literally the same object. (that works because Minecraft's code reuses the Vec3 object when caching the current delta movement)
* Check how much MSPT (milliseconds per tick) each world is using in `/mspt`
* Useful to figure out which worlds are lagging your server.
![Per World MSPT](docs/per-world-mspt.png)
* Parallel World Ticking
* "mom can we have folia?" "we already have folia at home" folia at home: [Parallel World Ticking](PARALLEL_WORLD_TICKING.md)
* "mom can we have folia?" "we already have folia at home" folia at home: [Parallel World Ticking](docs/PARALLEL_WORLD_TICKING.md)

We don't cherry-pick *everything* from other forks, only patches that I can see and think "yeah, I can see how this would improve performance" or patches that target specific performance/feature pain points in our server are cherry-picked! In fact, some patches that are used in other forks [may be actually borked](BORKED_PATCHES.md)...
We don't cherry-pick *everything* from other forks, only patches that I can see and think "yeah, I can see how this would improve performance" or patches that target specific performance/feature pain points in our server are cherry-picked! In fact, some patches that are used in other forks [may be actually borked](docs/BORKED_PATCHES.md)...

## Support

Because this is a fork made for SparklyPower, we won't give support for any issues that may happen in your server when using SparklyPaper. We know that SparklyPaper may break some plugins, but unless we use these plugins on SparklyPower, we won't go out of our way to fix it!

If you only care about some of the patches included in SparklyPaper, it is better for you to [create your own fork](https://github.com/PaperMC/paperweight-examples) and cherry-pick the patches, this way you have full control of what patches you want to use in your server, and even create your own changes!

## Downloads

You can download SparklyPaper's Paperclip JAR [here](https://github.com/SparklyPower/SparklyPaper/actions/workflows/build.yml). Click on a workflow run, scroll down to the Artifacts, and download!
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 4 additions & 2 deletions PARALLEL_WORLD_TICKING.md → docs/PARALLEL_WORLD_TICKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@ By default, Spark will profile the `Server thread` thread, which ain't good for

Spark has an undocumented configuration setting to configure what threads the background profiler will track.

In Spark's `config.json`, add `"backgroundProfilerThreadDumper": "Server thread,serverlevel-tick-worker-1,serverlevel-tick-worker-2,serverlevel-tick-worker-3,serverlevel-tick-worker-4,serverlevel-tick-worker-5,serverlevel-tick-worker-6,serverlevel-tick-worker-7,serverlevel-tick-worker-8"` (the thread list may vary if you changed your thread count) to dump the Server thread and the ServerLevel ticking worker threads.
In Spark's `config.json`, add `"backgroundProfilerThreadDumper": "all"` to dump all threads used in server.

Because Spark queries the thread list on startup, we prestart all the threads in the thread pool with `Util.SERVERLEVEL_TICK_EXECUTOR.prestartAllCoreThreads()`.
When looking at the profiler result, the server level tick threads are named `serverlevel-tick-worker [WorldNameHere]`.

We use a single thread per world instead of a thread pool to be easier to track down what thing is lagging which world. However, parallel thread execution is limited by a semaphore based on the `parallel-world-ticking.threads` value.

## Can I disable this?

Expand Down
Binary file added docs/per-world-mspt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 30bd3d6

Please sign in to comment.