9
0
mirror of https://github.com/SparklyPower/SparklyPaper.git synced 2025-12-24 17:39:30 +00:00
Commit Graph

85 Commits

Author SHA1 Message Date
MrPowerGamerBR
3b0a9a7780 [ci skip] README changes 2023-11-24 20:32:44 -03:00
MrPowerGamerBR
222bdcf9f5 Remove unused stuff 2023-11-24 20:25:57 -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
7044824d2d [ci skip] Improve canSee patch commit message 2023-11-24 11:46:36 -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
e509994f65 Change check order 2023-11-23 20:37:54 -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
d06438014c Disable "timings" command too 2023-11-23 12:14:29 -03:00
MrPowerGamerBR
54a3a0abc4 [ci skip] Add note about Timings 2023-11-23 12:13:17 -03:00
MrPowerGamerBR
5fe6f9d424 Disable Timings if Parallel World Ticking is enabled
Fixes #4
2023-11-23 12:10:13 -03:00
Loritta Morenitta
320fce2353 Updated Upstream (Paper) 2023-11-23 00:22:08 +00:00
MrPowerGamerBR
5248909b6f Fix CraftState use snapshot check 2023-11-22 16:14:05 -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
2067615d58 Thanks Gradle
I have no idea why this wasn't working
2023-11-22 13:50:35 -03:00
MrPowerGamerBR
dc7cea5f1b Set the property on every gradle invocation 2023-11-22 13:28:10 -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
537011dbfe Change workflow name 2023-11-22 11:43:13 -03:00
MrPowerGamerBR
af05df723e Actually let's use two different workflows instead 2023-11-22 11:42:20 -03:00
MrPowerGamerBR
680433bd11 Fix workflow 2023-11-22 11:32: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
3c39cf0c25 [ci skip] Add info about why patch "Optimize-random-calls-in-chunk-ticking" is borked 2023-11-22 02:31:17 -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
6dd174a103 [ci skip] Add note about Citizens' sleeping trait 2023-11-21 20:17:02 -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
dd77d31f76 Lazily create LootContext for criterions
For each player on each tick, enter block triggers are invoked, and these create loot contexts that are promptly thrown away since the trigger doesn't pass the predicate

To avoid this, we now lazily create the LootContext if the criterion passes the predicate AND if any of the listener triggers require a loot context instance
2023-11-21 12:20:27 -03:00
MrPowerGamerBR
53c15660ff [ci skip] Bring back haha funny tagline in the patch 2023-11-21 01:08:06 -03:00
MrPowerGamerBR
4b63f11e5a Make CraftBlockEntityState's DISABLE_SNAPSHOT thread safe 2023-11-21 01:02:49 -03:00
MrPowerGamerBR
8043704bb0 Only check for farm block moisture if the crop growth event wasn't cancelled 2023-11-21 00:50:26 -03:00
MrPowerGamerBR
0d0706ff13 Blazingly Simple Farm Checks 2023-11-20 23:07:10 -03:00
MrPowerGamerBR
5a10e7d710 Merge branch 'ver/1.20.2' of https://github.com/SparklyPower/SparklyPaper into ver/1.20.2 2023-11-20 14:51:49 -03:00
MrPowerGamerBR
3f75b842ed [ci skip] README changes 2023-11-20 14:50:58 -03:00
Loritta Morenitta
7633ca89e6 Updated Upstream (Paper) 2023-11-20 00:22:35 +00:00
MrPowerGamerBR
8bd484c287 Patch changes 2023-11-19 20:39:51 -03:00
MrPowerGamerBR
27b4f21dfc Fix Warriorrrr's item frame track rewrite patch due to server changes 2023-11-19 14:23:57 -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