9
0
mirror of https://github.com/SparklyPower/SparklyPaper.git synced 2025-12-19 15:09:27 +00:00
Commit Graph

53 Commits

Author SHA1 Message Date
MrPowerGamerBR
9902d2c3b5 [ci skip] Add 02/01/2024 SparklyPower SparklyPaper performance result 2024-01-02 18:05:35 -03:00
MrPowerGamerBR
6989f768a7 Update to Minecraft 1.20.4 2023-12-09 15:48:30 -03:00
MrPowerGamerBR
d9d7969b46 [ci skip] README changes 2023-12-02 22:39:54 -03:00
MrPowerGamerBR
95a2786276 Update Upstream
Yet another patch merged into Paper, yay!
2023-12-02 22:26:02 -03:00
MrPowerGamerBR
238b46685b Update Upstream
Another patch merged into Paper, woo
2023-12-02 19:09:56 -03:00
MrPowerGamerBR
44b8a578b6 [ci skip] README changes 2023-12-01 18:05:33 -03:00
MrPowerGamerBR
cfba21344d a 2023-12-01 18:01:42 -03:00
MrPowerGamerBR
9222c99c6c [ci skip] README changes 2023-11-27 00:21:46 -03:00
MrPowerGamerBR
b933223efe [ci skip] Whoops 2023-11-26 21:11:45 -03:00
MrPowerGamerBR
449a84ceb6 Remove unnecessary durability check in "ItemStack#isSimilar(...)" 2023-11-26 20:33:27 -03:00
MrPowerGamerBR
3c9992bf07 [ci skip] README changes 2023-11-26 14:36:22 -03:00
MrPowerGamerBR
b82e1078fe Split the tickBlockEntities optimization into two patches 2023-11-26 14:15:51 -03:00
MrPowerGamerBR
d8ba56e45b Update Upstream and Fix Build 2023-11-25 21:46:56 -03:00
MrPowerGamerBR
3b0a9a7780 [ci skip] README changes 2023-11-24 20:32:44 -03:00
MrPowerGamerBR
490f8a5ec6 Improve the "tickBlockEntities" patch by replacing the block entity list with a custom list that allows us to remove multiple indexes at once
Improves tile entity removal performance A LOT, no matter if only a single tile entity is being removed or a bunch of them
2023-11-24 20:17:27 -03:00
MrPowerGamerBR
d17719e4e3 Remove some "dubious" patches
Honestly, some of these changes felt like hopium "surely this will fix the lag issues", even tho in my mind these didn't make sense

Yeah, these methods do show up in the profiler, but does these *really* make sense? I don't think so, I think these are just useless patches that only attempt to hide the pain, instead of tackling the REAL issue that is causing these methods to show up in the profiler
2023-11-24 02:48:58 -03:00
MrPowerGamerBR
6b4c6a766f Cache the block entity's chunk coordinate key in the block entity itself
Again, this is seems like a small optimization, but it is actually useful because we avoid doing calculations for each block entity, and if your server has a lot of them, it adds up
2023-11-23 19:37:09 -03:00
MrPowerGamerBR
66cab91fc1 Cache last shouldTickBlocksAt result when ticking block entities 2023-11-23 18:26:19 -03:00
MrPowerGamerBR
8faa90e2e3 [ci skip] Thanks IDEA for processing stuff that I typed in another window 2023-11-23 14:58:29 -03:00
MrPowerGamerBR
b1d551395f Optimize "canSee" checks
The "canSee" checks is in a hot path, invoked by each entity for each player on the server if they are in tracking range, so optimizing it is pretty nice

First, we change the original "HashMap" to fastutil's "Object2ObjectOpenHashMap", because the containsKey throughput is better

Then, we add a "isEmpty()" check before attempting to check if the map contains something

This seems stupid, but it does seem that it improves the performance a bit, and it makes sense, "containsKey(...)" does not attempt to check the map size before attempting to check if the map contains the key

We also create a "canSee" method tailored for "ChunkMap#updatePlayer()", a method without the equals check (the "updatePlayer()" already checks if the entity is the same entity) and we cache the "isVisibleByDefault()" result between runs (this also seems a bit overkill because "isVisibleByDefault()" is just a method that returns a boolean, but because this is a hotpath, we need all optimizations that we can get
2023-11-23 14:52:18 -03:00
MrPowerGamerBR
a93396ebe5 Skip dirty stats copy when requesting player stats
There's literally only one getDirty call. Because the map was only retrieved once, we don't actually need to create a copy of the map just to iterate it, we can just access it directly and clear it manually after use.
2023-11-22 14:45:25 -03:00
MrPowerGamerBR
50c98ccbd5 [ci skip] README changes 2023-11-22 14:11:16 -03:00
MrPowerGamerBR
9715e4901d [ci skip] README changes (again) 2023-11-22 11:47:58 -03:00
MrPowerGamerBR
f75bd46df6 [ci skip] README changes 2023-11-22 11:47:35 -03:00
MrPowerGamerBR
b4a0b43344 Add build without Parallel World Ticking 2023-11-22 11:29:10 -03:00
MrPowerGamerBR
8dbc519375 Cache coordinate key used for nearby players when ticking chunks
The "getChunkKey(...)" call is a bit expensive, using 0.24% of CPU time with 19k chunks loaded

So instead of paying the price on each tick, we pay the price when the chunk is loaded

Which, if you think about it, is actually better, since we tick chunks more than we load chunks
2023-11-22 11:10:54 -03:00
MrPowerGamerBR
5457114057 [ci skip] README changes 2023-11-22 01:56:46 -03:00
MrPowerGamerBR
53dcccb2a5 Cache tracking range type enum ordinal
Yes, I was shocked, flabbergasted even, when I found out that "Enum.ordinal()" was lagging here

But I guess it makes sense: It is a function that is called every tick for each entity, and it is a bit wasteful converting from enum to ordinal every time
2023-11-22 01:51:29 -03:00
MrPowerGamerBR
d03d4b9f1d [ci skip] README changes (again) 2023-11-21 23:34:38 -03:00
MrPowerGamerBR
6e8885ab81 [ci skip] README changes (again) 2023-11-21 23:33:27 -03:00
MrPowerGamerBR
af841d584c [ci skip] README changes 2023-11-21 23:26:52 -03:00
MrPowerGamerBR
3f47e18bc4 Improve EntityScheduler optimization patch even... further... beyond! 2023-11-21 23:22:17 -03:00
MrPowerGamerBR
4d91dd604d Improve EntityScheduler optimization patch 2023-11-21 21:10:07 -03:00
MrPowerGamerBR
dfe57f34c4 Spooky month optimizations
The quintessential patch that other performance forks also have for... some reason

Caches when Bat's spooky season starts and ends, and when Skeleton and Zombies halloween starts and ends

Avoids unnecessary date checks, even tho that this shouldn't really improve performance that much... unless you have a lot of mobs being spawned
2023-11-21 17:08:58 -03:00
MrPowerGamerBR
96c5de6f94 Add option to change crops to go from first age to last age directly, to avoid useless block updates 2023-11-21 16:14:45 -03:00
MrPowerGamerBR
d80994bccc [ci skip] Update README 2023-11-21 12:21:22 -03:00
MrPowerGamerBR
0d0706ff13 Blazingly Simple Farm Checks 2023-11-20 23:07:10 -03:00
MrPowerGamerBR
3f75b842ed [ci skip] README changes 2023-11-20 14:50:58 -03:00
MrPowerGamerBR
82aee81eac [ci skip] Derp 2023-11-19 14:19:16 -03:00
MrPowerGamerBR
339d27f15c Replace item frame patch 2023-11-19 14:17:46 -03:00
MrPowerGamerBR
e028bd5157 Skip EntityScheduler's executeTick checks if there isn't any tasks to be run
On each tick, Paper runs EntityScheduler's executeTick of each entity. This is a bit expensive, due to ArrayDeque's size() call because it ain't a simple "get the current queue size" function, and due to the thread checks.

To avoid the hefty ArrayDeque's size() call, we check if we *really* need to execute the executeTick, by checking if currentlyExecuting is not empty or if oneTimeDelayed is not empty.

Most entities won't have any scheduled tasks, so this is a nice performance bonus. These optimizations, however, wouldn't work in a Folia environment, but because in SparklyPaper executeTick is always executed on the main thread, it ain't an issue for us (yay).
2023-11-19 13:41:45 -03:00
MrPowerGamerBR
3e549c4903 New optimization patches 2023-11-18 21:32:54 -03:00
MrPowerGamerBR
4bf4b3c60a [ci skip] Improve wording 2023-11-17 19:42:09 -03:00
MrPowerGamerBR
f7a3b8585c [ci skip] Add small "locked" map performance tip 2023-11-17 19:31:51 -03:00
MrPowerGamerBR
7907eb6a8f [ci skip] Whoops 2023-11-17 19:22:29 -03:00
MrPowerGamerBR
4098309e79 Refactor MapItem update skip, add synchornized to CraftMapColorCache's "isCached" function 2023-11-17 19:13:56 -03:00
MrPowerGamerBR
eed11e38b2 Skip "MapItem#update()" if the map does not have the CraftMapRenderer present
Optimizes "image in map" maps, without requiring the map to be locked, which some old map plugins may not do

This has the disadvantage that the vanilla map data will never be updated while the CraftMapRenderer is not present, but that's not a huuuge problem for us
2023-11-17 15:02:07 -03:00
MrPowerGamerBR
a5a401b566 [ci skip] More readme changes 2023-11-17 12:49:04 -03:00
MrPowerGamerBR
30bd3d6baa Update docs 2023-11-17 12:42:08 -03:00
MrPowerGamerBR
7b92cb8f66 Experimental Parallel World Ticking 2023-11-12 20:18:51 -03:00