alex9849 / advanced-region-market

A Bukkit/Spigot plugin for renting/selling WorldGuard regions
https://www.spigotmc.org/resources/advancedregionmarket.58732/
69 stars 45 forks source link

Optimize net.alex9849.arm.regions.RentRegion.updateSignText() #140

Closed matipoirierg closed 1 year ago

matipoirierg commented 1 year ago

Is there any way I can change the update rate of that function, so I can reduce the performance impact?. (https://spark.lucko.me/4aMJvPHkXi)

alex9849 commented 1 year ago

Yes, there is an option signupdateinterval in your config.yml. There you can configure in which interval all your regions get updated. But this doesn't mean that all your regions get updated in one tick at the begin of a new period. Instead the plugin spreads the load on each tick in your interval and updates a subset of all your regions in each tick, such that each region got updated once after one interval. Also the plugin only updates region signs that are located in chunks that are already loaded which further reduces the worlkload for your server. The update-function can cause load spikes if a region gets restored. In that case worldedit actions might get triggered which can be quite heavy depending on the size of your regions.