Skip to content

Commit

Permalink
[ci skip] Thanks IDEA for processing stuff that I typed in another wi…
Browse files Browse the repository at this point in the history
…ndow
  • Loading branch information
MrPowerGamerBR committed Nov 23, 2023
1 parent b1d5513 commit 8faa90e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ SparklyPaper's config file is `sparklypaper.yml`, the file is, by default, place
* The `canSee(...)` checks is in a hot path (`ChunkMap#updatePlayers()`), 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 fastutil's `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 hot path, we need all optimizations that we can get!Draem).
* 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 hot path, we need all optimizations that we can get!).
* 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)
Expand Down

0 comments on commit 8faa90e

Please sign in to comment.