-
-
Notifications
You must be signed in to change notification settings - Fork 3
[1.10.2] Flowing water causes extreme lag #4
Comments
I know the flowing flags are extremely "heavy" to handle and i'm already looking into a way to make them "lighter". For the parser, i already plan at some point to introduce the ability to store regions into a Database (probably a RedisDB, or making the type of DB selectable by config). The actual Json parser has been used because it's already into the SpongeAPI, and also because is really simple parsing a Java class into a Json (wich is how Regions are saved). But of course if you know a better parser that is also easy to use please let me know and i'll see if i can use that :) |
I did some work with IBM a little over a year ago, and we used the javax.json package for simple, fast json parsing and construction. The package is part of Java's JSON-P API, which can be found here. Just go to Download from the main page and click the link under the Specification heading. The API is typically part of Java EE, but the jar can be included in projects using Java SE. Of course, Universe Guard shouldn't load regions from disk every single time an event needs to be checked. I believe other protection plugins cache their data in memory and only save to disk until/unless a data reload command is sent. |
THank you for your suggestion. Caching region is also something i'm working on, cause i know that handling many regions is heavy :) I hope to add this cache system into the next release ;) |
Region cache added in the next version ;) |
Version 2.6 released! Read more at https://forums.spongepowered.org/t/universe-guard-2-an-easy-to-use-world-protection-plugin/21661/87 |
Whenever water is placed and allowed to flow with Universe Guard installed, whether inside or outside of a region, the server lags tremendously. Using Tick Profiler, I traced the lag back to com.universeguard.utils.RegionUtils.loadRegions, which calls com.google.gson.Gson.fromJson, which ends up using Java reflection to perform its task somewhere down the line, which causes extreme delays each tick. Switching to a different Json parser or adding other storage formats should resolve this problem.
The text was updated successfully, but these errors were encountered: